Hi All,
I'm currently working to create one single HTA script to manage User Accounts on Multiple domain, based on the User selection. Here is my sample script,
strUser = txt.valueIf strUser = vbNullString then
MsgBox "Please Enter the User Name to Proceed", 16, "Check User details"
End If
If rbtn1.Checked Then
strDomain = "Domain1"
End If
If rbtn2.Checked Then
strDomain = "Domain2"
End If
If rbtn3.Checked Then
strDomain = "Domain3"
End If
If rbtn4.Checked Then
strDomain = "Domain4"
End If
Set objUser = GetObject("WinNT://"& strDomain &"/" & strUser & "")
If Err.Number <> 0 Then
MsgBox (strUser) & " isn't a valid user name!", 48,"User Details"
Wscript.Quit
End If
Err.Clear
If objUser.IsAccountLocked=0 Then
strLocsta = "Not Locked"
else
strLocsta = "Locked"
End if
Here i have used buttons for selecting the domain, based on the button selection the respective domains will be selected.
Here is my trouble. Say im using this script on the Server which is part of Domain1 and from the same machine i could able to access Domain2 for which 389 Port were enabled using dsa.msc.
But when i use this script i could only able to get informations of the users on Domain1, if i select Domain2 im getting Network Path not found.
I'm looking for an option, where i can specify the domain controllers to get authenticate and retrieve users or is there anyway to overcome this problem.
Objective is that i need to get connected to the both domain controllers and get the users information. Kindly help me with some examples or syntax.
Regards,