You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Take ownership of the file$filePath= (Read-Host"Filepath")
$acl=Get-Acl-Path $filePath$acl.SetOwner([System.Security.Principal.NTAccount]$(Read-Host"Username"))
Set-Acl-Path $filePath-AclObject $aclGet-Acl-Path $filePath
# Set Access Controls of the file$filePath= (Read-Host"Filepath")
$acl=Get-Acl-Path $filePath$accessRule=New-Object System.Security.AccessControl.FileSystemAccessRule($(Read-Host"Username"),"FullControl","Allow")
$acl.SetAccessRule($accessRule)
Set-Acl-Path $filePath-AclObject $acl