SMTP Port 25

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

4 Responses to “Powershell to check if Account is Enable or Disabled.”

  1. Rudy Maes said

    The above expmle will mis account wit value 66050 thes account are normal accounts, disbale but have the don’t expire pasw flag set

  2. Paul M Vincent said

    Allways use BitWise operators when dealing with UserAccountControl..

    Change the evaluation statments to this

    if($Value -BAND 2 -eq 0)
    {
    Write.Output “Account Enabled”
    }
    else
    {
    Write-Output “Account Disabled”
    }

  3. BIll said

    I believe it should be:
    if(($value -BAND 2) -eq 0)
    But thanks, helped me go in the right direction.

  4. Seth said

    Way cool! Some very valid points! I appreciate you writing this article plus
    the rest of the website is extremely good.

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: