Server 2012 Active Directory some usefull powershell commands

In a server 2012 we can use powershell for get our works done easily.Im sharing some of them with this article.

1.Search inactive adaccounts with last login date

Search-ADAccount -AccountInactive|fl name,lastlogondate

 

2.Find no of computers using simple powershell commands( i have used one integer variable for get the count)

$intcomcount

$intcomcount=Get-ADComputer -Filter {name -like “*”}

$intcomcount.count

3.Find locked out ad accounts

Search-ADAccount -LockedOut

4.Find the active directory user groups with category and group scope

Get-ADgroup -Filter {name -like “*”}|ft name,groupscope,groupcategory

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 )

Google photo

You are commenting using your Google 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.