PowerShell for Windows Admins

Feb 14 2015   5:42AM GMT

Modifying AD attribute – PO Box

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:
Active Directory
Powershell

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

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: