Solved

List off all users who are disabled in the last month in Active directory 2008

Posted on 2013-10-30
3
2,242 Views
Last Modified: 2013-11-14
List off all users who are disabled in the last month in Active directory 2008

HI Guys,
IS any way I can run a command or script in PS to pull all the users who were disabled in the last month?

Also I need to get a list off all users who is created in the last month and there account is Active

Thanks
Rabih
0
Comment
Question by:Rabihhaj
3 Comments
 
LVL 5

Accepted Solution

by:
Recept earned 500 total points
ID: 39613089
The Native AD Powershell way;

Disabled in the last 30 days
Get-ADUser -LDAPFilter {(useraccountcontrol:1.2.840.113556.1.4.803:=2)} -Properties whenChanged | Where-Object {$_.whenChanged -gt (Get-Date).AddDays(-30)} | Select-Object Name, whenChanged

Created in the last 30 days
Get-ADUser -Filter * -Properties whenCreated | Where-Object {$_.whenCreated -gt (get-date).AddDays(-30)} | Select-Object Name, whenCreated


The Quest AD Cmdlets way;

Disabled in the last 30 days
Get-QADUser -Disabled | Where-Object {$_.whenChanged -gt (get-date).AddDays(-30)} | Select-Object Name, whenChanged

Created in the last 30 days
Get-QADUser | Where-Object {$_.whenCreated -gt (get-date).AddDays(-30)} | Select-Object Name, whenCreated


Unfortunately there is no AD attributed for WhenDisabled so all we can do is check for disabled accounts which have been modified in the last 30 days.
0
 
LVL 10

Expert Comment

by:Gajendra Rathod
ID: 39613389
You case install Active Directory Query Tool and find out the user information easily.
0
 

Author Comment

by:Rabihhaj
ID: 39649396
Hi Gajendra,

I do have the tool installed is any instruction you can send me to do that

Thanks
RAbi h
0

Featured Post

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Join & Write a Comment

This is my 3rd article on SCCM in recent weeks, the 1st (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html) dealing with installat…
Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

15 Experts available now in Live!

Get 1:1 Help Now