Hello all,
I want to grab the user home folder from an AD domain and compare this user account information to the same accounts residing on the backup domain controller.
The reason for the mixup is the result of a migration from NT40 to AD
I have a script here that writes this account and homefolder to a log file. From this point I would like to compare these accounts to the account info on the Backup DC
Here is what I have so far
See code below ============================Const ForReading = 1
Const Forwriting = 2
Const ForAppending = 8
Dim objFSO
Set ObjOU= GetObject ("LDAP://ou=Fabrikan,DC=Ent,DC=AD,DC=ntrs,DC=com")
LogFilePath = "E:\Data\Logs\"
LogFolder = "HomeFolderNames"
LogFile = "HomeFolder.log"
'strComputer = "."
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(LogFilePath & LogFolder)Then
Set LogFile=objFSO.CreateTextFile(LogFilePath & "\" & Logfolder & "\" & LogFile)
Else
Set LogFolder=ObjFSO.CreateFolder(LogFilePath & "\" & LogFolder)
Set LogFile=objFSO.CreateTextFile(LogFilePath & "\" & LogFolder & "\" & LogFile, True)
End If
For Each ObjUser In ObjOU
Home=ObjUser.HomeDirectory
wscript.echo Home
If ObjUser.HomeDirectory = " " Then
logFile.skip
Else
logfile.writeline home & VbCrLf
End If
'On Error Resume next
' If Left (UCase(home),12) = "\\SERVER001\" then
' home = Replace (UCase (home) ,"\\SERVER001\","\\SERVER002\")
' WScript.Echo home
' End If
'ObjUser.Put "HomeDirectory" , home
' ObjUser.SetInfo
Next
Set objOU = Nothing
I want to grab the user home folder from an AD domain and compare this user account information to the same accounts residing on the backup domain controller.
The reason for the mixup is the result of a migration from NT40 to AD
I have a script here that writes this account and homefolder to a log file. From this point I would like to compare these accounts to the account info on the Backup DC
Here is what I have so far
See code below ============================Const ForReading = 1
Const Forwriting = 2
Const ForAppending = 8
Dim objFSO
Set ObjOU= GetObject ("LDAP://ou=Fabrikan,DC=Ent,DC=AD,DC=ntrs,DC=com")
LogFilePath = "E:\Data\Logs\"
LogFolder = "HomeFolderNames"
LogFile = "HomeFolder.log"
'strComputer = "."
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(LogFilePath & LogFolder)Then
Set LogFile=objFSO.CreateTextFile(LogFilePath & "\" & Logfolder & "\" & LogFile)
Else
Set LogFolder=ObjFSO.CreateFolder(LogFilePath & "\" & LogFolder)
Set LogFile=objFSO.CreateTextFile(LogFilePath & "\" & LogFolder & "\" & LogFile, True)
End If
For Each ObjUser In ObjOU
Home=ObjUser.HomeDirectory
wscript.echo Home
If ObjUser.HomeDirectory = " " Then
logFile.skip
Else
logfile.writeline home & VbCrLf
End If
'On Error Resume next
' If Left (UCase(home),12) = "\\SERVER001\" then
' home = Replace (UCase (home) ,"\\SERVER001\","\\SERVER002\")
' WScript.Echo home
' End If
'ObjUser.Put "HomeDirectory" , home
' ObjUser.SetInfo
Next
Set objOU = Nothing