Powershell to check check user Security Permission using Dscals
Posted by Krishna - MVP on March 18, 2010
Powershell to check if set of users for security security permission. Below script helps to check if users has Account Operators listed in security permission
$csv = Import-csv -path "D:\Krishna\dsacls\user.csv"
foreach($line in $csv)
{
$input = "\\Servername\" + $line.DN
$K = .\dsacls.exe $input
$i = 1
foreach ($service in $K)
{
$Status = $service -like "Allow BUILTIN\Account Operators*"
if ($status -eq $true)
{
i= 0
}
}
if($i -eq 1)
{
$line.mailnickname >> dcalsresult.txt
}
You can also find the copy in the below link
http://powershell.com/cs/members/smtpport25.wordpress/files/UserSecurityPermission.ps1.aspx

