Radim88
asked on
Powershell - create script for removing all ACLs and leaving only administrator and system
Hello, I am thinking about script, which will get users from csv file, and remove them ACLs and leave only system, and administrator.
$DomainName = "xxx"
Import-CSV "C:\test.csv" | %{
# Get the folder
$Folder = Get-Item $_.ColumnA
$ACL = Get-ACL $Folder
xxxxxxx
$ACL.AddAccessRule($Access Rule)
Set-ACL $NewFullName -AclObject $ACL
}
Any ideas?
Mant BR
$DomainName = "xxx"
Import-CSV "C:\test.csv" | %{
# Get the folder
$Folder = Get-Item $_.ColumnA
$ACL = Get-ACL $Folder
xxxxxxx
$ACL.AddAccessRule($Access
Set-ACL $NewFullName -AclObject $ACL
}
Any ideas?
Mant BR
the csv files contain list of folders (not users) from which you with to remove all ACL users except system and administrator, is that correct?
ASKER
Yes the list of folders thats correct:
ColumnA
folder1
folder2
folder3
ColumnA
folder1
folder2
folder3
ASKER
yes and I want to remove ACLs except of system and administrator for all folders listed in csv.
ColumnA
\\xxx\folder1
\\xxx\folder2
\\xxx\folder3
something like this.
ColumnA
\\xxx\folder1
\\xxx\folder2
\\xxx\folder3
something like this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.