Solved

Check if user AD account is disabled

Posted on 2016-09-28
3
26 Views
Last Modified: 2016-09-28
How can I check if a users AD account is disabled?
0
Comment
Question by:Roccat
3 Comments
 
LVL 12

Assisted Solution

by:Dustin Saunders
Dustin Saunders earned 250 total points
ID: 41820508
Get-ADUser -Filter {samaccountName -eq "dsaunders"}

Open in new window


Will show you the results of the account with the matching sAMAccountName.

You can also use the .Enabled property.
$user = Get-ADUser -Filter {samaccountName -eq "dsaunders"}
Write-Host $user.Enabled

Open in new window

0
 
LVL 40

Accepted Solution

by:
Subsun earned 250 total points
ID: 41820521
You don't have to use the Filter, directly run the Get-ADUser against user name (a bit faster than using Filter)
Import-Module ActiveDirectory
Get-ADUser UserName | Select Name,Enabled

Open in new window

If Enabled shows True then account is enabled, if it shows False then account is disabled.
0
 

Author Closing Comment

by:Roccat
ID: 41820539
Thanks again!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Set OWA language and time zone in Exchange for individuals, all users or per database.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now