Solved

Unlocking bulk AD user accounts through Script

Posted on 2014-11-14
6
976 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
0
Comment
Question by:Gautam Chaudhary
  • 3
  • 2
6 Comments
 
LVL 24

Accepted Solution

by:
VB ITS earned 500 total points
ID: 40442700
No need for a text file, the below will simply identify accounts within an OU that are locked out and then unlock the account for you.
Import-Module ActiveDirectory
Search-ADAccount –SearchBase ‘OU=India,DC=XYZ,DC=com’ –LockedOut | Unlock-ADAccount

Open in new window

0
 

Author Comment

by:Gautam Chaudhary
ID: 40442848
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
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40443651
Add -Passthru

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

Open in new window

0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Closing Comment

by:Gautam Chaudhary
ID: 40445560
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.
0
 

Author Comment

by:Gautam Chaudhary
ID: 40445561
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
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40447237
Gautam,

Yes I can help you, please post a new question as you have selected an answer for this one already.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

821 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