Setting and Removing the ipPhone field with Powershell (July 27 2014)
We currently have a project going on that requires we populate the ipPhone field of several hundred users. Sounds like this should be a simple call to Set-ADuser like this:
Set-ADuser -Identity SomeUser -ipPhone "5000"
But sadly this will error. Why? because the Set-ADuser does not have a ipPhone parameter. Instead we need to do a little more work. Here is the command I ended up using.
Get-ADuser -Identity SomeUser | Set-ADuser -Replace @{ipPhone="5000"}
But what if we wanted to remove the entry? Simply get the current value and pass it along to the set command with the remove command. Something like this.
Get-ADuser -Identity SomeUser -Properties ipPhone| Set-ADuser -Remove @{ipPhone=$_.ipPhone}