Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with logic in code

Status
Not open for further replies.

Councilk

MIS
May 14, 2003
72
0
0
US
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top