Powershell to check check user Security Permission using Dscals

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s