Thursday 18 December 2014

Append Description Active Directory VB Script

This is a script to prepend a string to the start of the description to users in active directory. In this case it adds "Nil Usage - " to the start of the description field of the user account details in active directory.

Set OU = GetObject(LDAP://DNSHOSTNAMEOFDC/OU=Test,DC=TESTDOMAIN,DC=co,DC=uk)
For Each oUser In OU
If oUser.Class = "user" Then
oUser.Put "description", "Nil Usage - " & oUser.Description
oUser.SetInfo
End If
Next
Wscript.echo "Test OU has been updated!"
Wscript.Quit

Friday 5 December 2014

Find SMTP Addresses in Active Directory

When creating a new mailbox you may come across the message "this email address already exists in this organisation". This can be common when you have lot of shared mailboxes and it can be difficult to find which account has a particular email address assigned to it, and there is not an easy built in search to achieve this.
Open an active directory search, in the find drop down box choose custom search, and then the advanced tab. Type in the following query:

proxyaddresses=smtp:emailaddress@domain.com

The wildcard can also be used if you don't know the whole address e.g. proxyaddresses=smtp:bob* will search for all smtp addresses beginning with bob.