This script will migrate LDAP and SiteServer user list to another LDAP SiteServer
<%
Option Explicit
Call MigrateMembers
Sub MigrateMembers
Dim strSourceLdapPath
Dim strTargetLdapPath
Dim strFontStyle
Dim oLDAP
Dim oADsSourceContainer
Dim oADsTargetContainer
Dim oADsNewUser
Dim oADsOldUser
On Error Resume Next
strFontStyle = ""
'**********************************************************
' Enter the LDAP Source Members Path To Copy From...
'**********************************************************
' strTargetLdapPath = "LDAP://SourceLDAPMachine:389/dc=mycompany/dc=com"
strSourceLdapPath = "LDAP://Piett:1003/o=SRC/ou=members"
'**********************************************************
' Enter the LDAP Target Members Path To Copy To...
'**********************************************************
' strTargetLdapPath = "LDAP://TargetLDAPMachine:389/dc=mycompany/dc=com"
strTargetLdapPath = "LDAP://Xfernal:389/o=SRC/ou=members"
Set oLDAP = GetObject("LDAP:")
If Err.Number <> 0 Then
Response.Write strFontStyle & Err.Number & Err.Description
End If
'**********************************************************
' This must be set to the Admin Account on the the LDAP Source
'**********************************************************
Set oADsSourceContainer = oLDAP.OpenDSObject(strSourceLdapPath, _
"cn=Administrator,ou=Members,o=SRC", "secret", 0)
If Err.Number <> 0 Then
Response.Write strFontStyle & Err.Number & Err.Description
End If
'**********************************************************
' This must be set to the Admin Account on the the LDAP Target
'**********************************************************
Set oADsTargetContainer = oLDAP.OpenDSObject(strTargetLdapPath, _
"cn=Administrator,ou=Members,o=SRC", "password", 0)
If Err.Number <> 0 Then
Response.Write strFontStyle & Err.Number & Err.Description
End If
'**********************************************************
' oLDAP is not needed anymore; destroy...
'**********************************************************
Set oLDAP = Nothing
Response.Write ""
"
Set oADsSourceContainer = Nothing
Set oADsTargetContainer = Nothing
Set oADsOldUser = Nothing
Response.Write "Members Migrated..."
End Sub
%>
Option Explicit
Call MigrateMembers
Sub MigrateMembers
Dim strSourceLdapPath
Dim strTargetLdapPath
Dim strFontStyle
Dim oLDAP
Dim oADsSourceContainer
Dim oADsTargetContainer
Dim oADsNewUser
Dim oADsOldUser
On Error Resume Next
strFontStyle = ""
'**********************************************************
' Enter the LDAP Source Members Path To Copy From...
'**********************************************************
' strTargetLdapPath = "LDAP://SourceLDAPMachine:389/dc=mycompany/dc=com"
strSourceLdapPath = "LDAP://Piett:1003/o=SRC/ou=members"
'**********************************************************
' Enter the LDAP Target Members Path To Copy To...
'**********************************************************
' strTargetLdapPath = "LDAP://TargetLDAPMachine:389/dc=mycompany/dc=com"
strTargetLdapPath = "LDAP://Xfernal:389/o=SRC/ou=members"
Set oLDAP = GetObject("LDAP:")
If Err.Number <> 0 Then
Response.Write strFontStyle & Err.Number & Err.Description
End If
'**********************************************************
' This must be set to the Admin Account on the the LDAP Source
'**********************************************************
Set oADsSourceContainer = oLDAP.OpenDSObject(strSourceLdapPath, _
"cn=Administrator,ou=Members,o=SRC", "secret", 0)
If Err.Number <> 0 Then
Response.Write strFontStyle & Err.Number & Err.Description
End If
'**********************************************************
' This must be set to the Admin Account on the the LDAP Target
'**********************************************************
Set oADsTargetContainer = oLDAP.OpenDSObject(strTargetLdapPath, _
"cn=Administrator,ou=Members,o=SRC", "password", 0)
If Err.Number <> 0 Then
Response.Write strFontStyle & Err.Number & Err.Description
End If
'**********************************************************
' oLDAP is not needed anymore; destroy...
'**********************************************************
Set oLDAP = Nothing
Response.Write "
" 'This error description is: "Cannot create a file when that file already exists" If Err.Number = -2147024713 Then Response.Write strFontStyle & "Member Already Exists." End If If Err.Number <> 0 Then Response.Write strFontStyle & Err.Number & Err.Description End If Response.Write strFontStyle & oADsOldUser.cn & vbCrLf Response.Write " |
Set oADsSourceContainer = Nothing
Set oADsTargetContainer = Nothing
Set oADsOldUser = Nothing
Response.Write "Members Migrated..."
End Sub
%>
Views 4430 Downloads 1351