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

This entry was posted in PowerShell and Active Directory. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s