Set employeeID on Contact

Hello,

This should be simple, but I can't figure out how to retrieve or set the employeeID field on a contact.

Thanks,
JJ
LVL 37
Jamie McKillopIT ManagerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Joseph DalyConnect With a Mentor Commented:
Actually nevermind it looks like you can do this with the MS AD tools.

Get-adobject {object} | set-adobject -Add @{employeeID='333333333333'}


http://technet.microsoft.com/en-us/library/ee617254.aspx
0
 
Joseph DalyCommented:
So this is something that I think microsoft still needs to work on in their powershell modules. I tested this with both MS AD and exchange modules and can see no easy way of updating contact with the employee id.

However if you choose to use the Quest powershell cmdlets this is pretty simple. The quest cmdlets provide the -objectattributes switch which lets you update information that may not be exposed by one of the standard switches.

get-qadobject contactname | set-qadobject -objectattributes @{employeeID='3333333333'}
0
 
Jamie McKillopIT ManagerAuthor Commented:
Thanks for your reply Joseph. I've also figured out how to do this with the standard AD module.

Get-ADObject -Filter 'ObjectClass -eq "contact"' | % {
	Set-ADObject $_ -Clear employeeid
}

Open in new window


I'm specifically looking to clear the field but you could also use -Add or -Replace to change values.

JJ
0
All Courses

From novice to tech pro — start learning today.