Script to disable and add description

%3CLINGO-SUB%20id%3D%22lingo-sub-2202975%22%20slang%3D%22en-US%22%3EScript%20to%20disable%20and%20add%20description%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202975%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20hoping%20to%20find%20someone%20that%20could%20add%20the%20correct%20stanza's%20to%20my%20script.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20disabling%20in%20bulk%20AD%20accounts%20and%20I%20need%20to%20add%20something%20to%20the%20description%20like%20when%20disabled.%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p1%22%3EThis%20is%20the%20script%20I%20am%20using....%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3E%24File%20%3D%20Import-Csv%20-Path%20%22termedusers.csv%22%3C%2FP%3E%3CP%20class%3D%22p2%22%3Eforeach%3C%2FP%3E%3CP%20class%3D%22p2%22%3E(%24employeeID%20in%20%24termedusers)%3C%2FP%3E%3CP%20class%3D%22p2%22%3E%7B%3C%2FP%3E%3CP%20class%3D%22p2%22%3ESet-ADUser%3C%2FP%3E%3CP%20class%3D%22p2%22%3E%3CBR%20%2F%3E-Identity%20%24Name%20-Enabled%20%24False%3C%2FP%3E%3CP%20class%3D%22p2%22%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2202975%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I was hoping to find someone that could add the correct stanza's to my script. 

I am disabling in bulk AD accounts and I need to add something to the description like when disabled. 

This is the script I am using....

 

 

$File = Import-Csv -Path "termedusers.csv"

foreach

($employeeID in $termedusers)

{

Set-ADUser


-Identity $Name -Enabled $False

}

1 Reply
Set-ADUser TheUserName -replace @{info="Why i am disabled"}


-----------
If this answer help, please click on Best Response