Link to home
Start Free TrialLog in
Avatar of adamtrask
adamtrask

asked on

Using PowerShell to check if an ADUser is disabled to enable or enabled to disabled

Good morning experts,

This morning I received two lists for checking - both of Adjunct instructors in our college.
One list has the current instructors, who should be enabled in active directory and the second contains Adjuncts who left us and need to be disabled.

I  need to learn to use an if statement to check if a certain person is enabled to disable him/her: Something like the following in correct PowerShell syntax:

if (InstructorName enabled == true)
{
InstructorName enabled = false;
}

Thank you for your help
Adam
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adamtrask
adamtrask

ASKER

Thank you very much.... let me ask while you are here if you know of a powershell book or sound tutorial for Active Directory..
Sadly no. But you only need to know a few basics about PowerShell, and a few about ActiveDirectory, to be able to run simple tasks. Most of it is trying out anyway, and PS is a great tool for doing that.
Thank you Qlemo,,,