Pumpernickel
asked on
Disable Inactive Active Directory Accounts POWERSHELL Script
I'm sure this has been done plenty of times but I can't seem to find a script that will disable active directory accounts (OU = Users) after 90 days of inactivity and move them to another OU called 'Users - Disabled'. Would anyone be able to provide me with a powershell script that would do this?
Server 2008 Standard SP2
Server 2008 Standard SP2
Ah, my mistake... this is for computer accounts, sorry.
It shouldn't be too difficult to change to user accounts, though.
To disable a user's account, set the UserAccountControl attribute to 0x0202 (0x002 + 0x0200)
http://support.microsoft.c om/kb/3051 44
It shouldn't be too difficult to change to user accounts, though.
To disable a user's account, set the UserAccountControl attribute to 0x0202 (0x002 + 0x0200)
http://support.microsoft.c
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What would be the best way to do this, powershell or VB? I'm starting to rethink of this issue and trying to figure out the best way.
It doesn't really matter which way you do this.
In terms of programming, I understand that PS is more versatile for manipulation of Microsoft systems, but unless you're actually doing the programming, this is a moot point.
So, a choice of VB or PS is like a choice of bourbon or whiskey. Both will get you drunk, but it's simply a matter of which you prefer.
In terms of programming, I understand that PS is more versatile for manipulation of Microsoft systems, but unless you're actually doing the programming, this is a moot point.
So, a choice of VB or PS is like a choice of bourbon or whiskey. Both will get you drunk, but it's simply a matter of which you prefer.
http://www.rlmueller.net/P