header image

Modifying AD attribute – PO Box

Posted by: | February 14, 2015 Comments Off on Modifying AD attribute – PO Box |

I was left a question on this post – https://richardspowershellblog.wordpress.com/wp-admin/post.php?post=2762&action=edit

Asking how to modify the PO Box value for a user account. 

 

This attribute can be set on the Address tab of AD Users and Computers but isn’t directly visible through AD Administrative Center.

 

The first trick is to discover the real name of the attribute. One method is to use the Attribute Editor tab in the GUI tools or you can do this:

£> Get-ADUser -Identity richard -Properties * | select *box*

POBox
—–

 

This is where life gets interesting because the actual name of the attribute is postOfficeBox.

 

Still to set the value

£> Get-ADUser -Identity fgreen -Properties * | select Name, POBox

Name                                                        POBox
—-                                                        —–
Fred Green

£> Get-ADUser -Identity fgreen -Properties * | Set-ADUser -POBox ‘MX234’
£> Get-ADUser -Identity fgreen -Properties * | select Name, POBox

Name                                                        POBox
—-                                                        —–
Fred Green                                                  MX234

 

Set-ADuser has a parameter specifically for that attibute

 

If you need to set the PO Box as part of a bulk change follow the style given in the post at the top of this article and add the –POBox parameter to Set-ADuser

under: PowerShell and Active Directory

Comments are closed.

Categories