Link to home
Start Free TrialLog in
Avatar of SEHC
SEHCFlag for Canada

asked on

PowerShell Set-ADUser

Hi

I am trying to set up the command to Set-ADUser via the users employeeID and to add a comment in to the extensionAttribute.  I am hoping someone can help I looked at the MS site but I think I am missing something here.

Set-ADUser -EmployeeID "12345" -extensionAttribute12 "1235"
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

Try this:
Set-Mailbox -Identity "12345" -ExtensionCustomAttribute12 @{Add="12345"}

you need to use Set-QADUser instead.
Try this:
set-aduser -identity "12345" -add @{extensionAttribute12='1235' }
Avatar of SEHC

ASKER

Set-Mailbox -Identity "12345" -ExtensionCustomAttribute12 @{Add="12345"}

the Identity in the command line is username not employeeID as I want to use that as the lookup for the user.
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 SEHC

ASKER

that did not work??
First try the Get-ADUser with filter, without the pipeline. That shows whether there is an object found:
Get-ADUser -Filter {EmployeeID -eq '12345'}

Open in new window

Does that return an user?
Avatar of SEHC

ASKER

Get-ADUser -Filter {EmployeeID -eq '12345'}  works after I add the Pipe it does nothing
SOLUTION
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