Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script that move disable user to Disable OU

Status
Not open for further replies.

NewToo

Technical User
Jun 11, 2001
136
Hello,

I'm new in scripting so thank very much for the help....

I'm truing to find a script that move all disable user and base on the last log on date to disable the users and move them to an OU. May I ask if anyone has a script that i can use?


thanks
Tony Hoang
 
search AD: Move a user to an OU: Disable a User:
Last logon date is a harder one since this information is not replicated.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
You can use the "lastLogonTimestamp" attribute in a native 2003 AD. This attribute is only updated once every 7 days, but if your are looking for accounts not logged in for 60+ days, then this attribute is accurate enough.

By doing that, you don't have to try to connect to each DC in turn and determine what the most accurate date is.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top