Does anyone know how to change the employeeNumber attribute on a mail contact in AD using PowerShell?
Nether New-MailContact, Set-MailContact or Set-Contact have a option for employeeNumber.
Asking google brings up questions about updating a user object, not a contact.
CodePudding user response:
you can use set-adobject, the syntax is:
#This variable must contain the value to set
$id = [employeeId]
#-replace will replace a existing value with a new one
set-adObject -Identity [distinguishedName] -replace @{employeeId=$id}