We help IT Professionals succeed at work.

Unlocking bulk AD user accounts through Script

3,254 Views
Last Modified: 2014-11-17
Please help me developing a script (Powershell/ VBS/ command line) for unlocking bulk AD user accounts . Script will be fetching the list of IDs from a .txt / .xls file

Distinguished name for the OU where i am having permission is mentioned below

OU=India,DC=XYZ,DC=com
Comment
Watch Question

Specialist Consultant
CERTIFIED EXPERT
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Gautam ChaudharyExecutive

Author

Commented:
It is a PS script...right but what do i do if i need to see the output for the query that what all are the accounts that has been unlocked
Joshua GrantomSystems Administrator
CERTIFIED EXPERT
Top Expert 2014

Commented:
Add -Passthru

Import-Module ActiveDirectory
Search-ADAccount –SearchBase ‘OU=India,DC=XYZ,DC=com’ –LockedOut | Unlock-ADAccount -Passthru

Open in new window

Gautam ChaudharyExecutive

Author

Commented:
Thanks VB ITS.... this solves half of my purpose....Please help if i have to unlock and reset password at the same time for a handful of domain IDs.
Gautam ChaudharyExecutive

Author

Commented:
Thanks Joshua Grantom.
Can you please help if i have to unlock and reset password at the same time for a handful of domain IDs provided the list of IDs will be fetched from a file kept at a location
Joshua GrantomSystems Administrator
CERTIFIED EXPERT
Top Expert 2014

Commented:
Gautam,

Yes I can help you, please post a new question as you have selected an answer for this one already.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.