SMTP Port 25

Anything and Everything Related to Messaging and Collaboration, Active Directory and Scripting. It’s My Life!!!

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

About these ads

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 )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 49 other followers

%d bloggers like this: