Hi,
I am getting an error at line 22, char 17. I was able to execute this once succesfully, not sure what changed in between..Can any one find what the error is.
$loc = Read-Host 'Where do you want to create the folder? '$fol = Read-Host 'Enter the name of the folder to be created? '
New-Item -ItemType directory -Path $loc\$fol
$t = Get-Acl $loc
$computer = Read-Host 'Enter the full computer name'
$username = Read-Host 'user'
$objUser = New-Object System.Security.Principal.NTAccount("$computer\$user")
$Rights = [system.security.accesscontrol.filesystemrights]"Read, Write"
$Type = [system.security.accesscontrol.accesscontroltype]::Allow
$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::ObjectInherit
$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::None
$objACE = New-Object System.Security.AccessControl.FileSystemAccessRule($objUser, $Rights, $InheritanceFlag, $PropagationFlag, $Type)
$t.addAccessRule($objACE)
Set-Acl $loc\$fol $t