Set Note on Telephone tab

The telephone tab in AD Users and Computers has a Notes section. This can be manipulated in a similar manner to the street address field on the Address tab. The Notes field on the GUI stores its data in the info attribute.

$ou = "OU=BlogTests,DC=Manticore,DC=org"            
$note = @"
Once upon a time something happened

In a galaxy far away
$name = "UserA"            
Get-ADUser -Identity $name |            
Set-ADUser -Replace @{info = $note}            
"`nAD provider"            
$name = "UserB"            
$dn = "cn=$name,$ou"            
Set-ItemProperty -Path AD:\$dn  -Name info -Value $note  -Force            
$name = "UserC"            
Get-QADUser -Identity $name |            
Set-QADUser  -ObjectAttributes @{info=$note}            
$name = "UserD"            
$dn = "cn=$name,$ou"            
$user = [adsi]"LDAP://$dn"            
$ = $note            

Use a here-string to create the text – ensures line breaks are honoured.

Use the –Replace parameter with the Microsoft cmdlets and –ObjectAttributes with Quest cmdlets.

The provider requires Set-ItemProperty and the script is a straight setting of the info attribute.

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: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s