I'm tring to create a routine that uses LDAP to automatically add users with RAS access. I've been able to write a VBScript that does this but I can only get it to run on the Win2003 server where the accounts are maintained. I need to be able to run this code on a different machine. I did succeed in using the WinNT:\\ provider while on a different machine but with WinNT:\\ I couldn't access all the required user account properties.
The following code works when run on a remote computer:
Set dso = GetObject("WinNT:")
Set container = dso.OpenDSObject("WinNT://" & domainName, userName, password, 0)
The followiing code only runs on the server:
Set objDomain = GetObject("LDAP://CN=Users, DC=centralpetwest, DC=local")
It yields the following error:
Error: The specified domain either does not exist or could not be contacted.
I haven't been able to figure out how to logon to the server either within the GetObject() call or before it.
Thanks in advance,
John C. Christensen (VBScript nubie)