Solved

Unlocking bulk AD user accounts through Script

Posted on 2014-11-14
6
896 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

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.

Question has a verified solution.

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

Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

770 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