Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/o=ExampleAB/ou=Organizationalunit1/cn=Recipients/cn=[blue]mmaclachlan[/blue]
[green]
'==========================================================================
'
' NAME: FixX500.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : 7/16/2009
' COPYRIGHT ¬ 2009, All Rights Reserved
'
' [blue]THIS SCRIPT AND MANY MORE MAY BE FOUND IN
' THE ADMIN SCRIPT PACK FROM THE SPIDER'S PARLOR
' HTTP://WWW.THESPIDERSPARLOR.COM/PRODUCTS[/blue]
'
' COMMENT: Add an X500 address to a user account to ensure user can
' reply to old mail after being moved to a new Exchange group.
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'==========================================================================
[/green]
On Error Resume Next
Dim qQuery, objConnection, objCommand, objRecordSet
Dim oRootDSE, strDomain, objUser
Const ADS_PROPERTY_APPEND = 3
x500Base = "[red]/o=ExampleAB/ou=Organizationalunit1/cn=Recipients/cn=[/red]"
Set oRootDSE = GetObject("LDAP://rootDSE")
strDomain = oRootDSE.get("defaultNamingContext")
[green]
' other categories = computer, user, printqueue, group[/green]
qQuery = "<LDAP://" & strDomain &">;" & _
"(objectCategory=person)" & _
";sAMAccountName,distinguishedName;subtree"
[green]
'Perform our query of AD for user objects[/green]
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Open "Provider=ADsDSOObject;"
objCommand.ActiveConnection = objConnection
objCommand.CommandText = qQuery
Set objRecordSet = objCommand.Execute
While Not objRecordSet.EOF[green]
'Bind to the user object[/green]
Set objUser = GetObject("LDAP://" & objRecordSet.Fields("distinguishedName"))[green]
'Add the X500 Address[/green]
objUser.PutEx ADS_PROPERTY_APPEND, "proxyAddresses", Array("X500:" & x500Base & objRecordSet.Fields("sAMAccountName"))
objUser.SetInfo
objrecordset.MoveNext
Wend
objConnection.Close
[green]'Notify user we are done[/green]
MsgBox "Done"