Powershell to Noob Translation?
hi all! i'm new powershell, , i've been tasked updating whole organizational unit new logins reflect new domain name. previous person did left script says:
import-csv c:\uploadtest.csv | %{set-aduser $_.samaccountname -userprincipalname $_.userprincipal}
while i've been able follow instructions prepare .csv, couldn't figure out script doing, wanted ask help!
ps. i've reseached powershell class i'm going boss approve.
thanks much!
hi tachc,
import-csv c:\uploadtest.csv, commandlet importing uploadtest.csv file.
"|" - call pipe. means pass information other commandlet
"%" - stands foreach. alias.
import-csv c:\uploadtest.csv | %{set-aduser $_.samaccountname -userprincipalname $_.userprincipal}
so, here importing .csv file looping through amaccountname, userprincipal column or data passing through pipe. calling set-aduser comdlet modify iformation in ad. hope helps you.
thanks,
sabah shariq
Windows Server > Windows PowerShell
Comments
Post a Comment