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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenDSObject - HELP!!!

Status
Not open for further replies.

josephk73

Technical User
Aug 1, 2002
115
GB
Hi Guys,

Need some help/suggestions on using OpenDSObject.

Just as a reminder, this is a method to bind to an object using WinNT or LDAP providers. Its importance is that it allows binding to a remote object using ALTERNATE credentials.

The single example I have seen uses this code:

Code:
userName = "login"
oldPasswd = "oldPasswd" 
newPasswd = "newPasswd" 
Set obj = GetObject("WinNT:") 
Set dom = "orion"
obj.OpenDSObject("WinNT://myWinNTDomain","myWinNTDomain\anAdministrator","adminPassword", 1) 
for each usr in dom 
    if usr.Name = userName Then 
        exit for 
    End if 
Next
However when I try to use this or a variation of it, I simply get the following error message:

Microsoft VBScript compilation error: Cannot use parentheses when calling a Sub


The above is an example I found on the internet. I'm actually trying to ennumerate local group membership on a remote server. However my script bombs out with the same error message.

PLEASE NOTE, CORRECT SUBSTITUTION IS MADE IN THE ABOVE STRING - BUT THE ERROR OCCURS EVEN BEFORE THE CODE EXECUTES

Now I've tried to cut this in various ways, but it always bombs out with some kind of error.

Does anybody know how to make this work?

If this cant work, does anybody know if there are any other simple methods of quering remote group membership, without using the WinNT or LDAP providers?
 
try
Code:
Call obj.OpenDSObject("WinNT://myWinNTDomain","myWinNTDomain\anAdministrator","adminPassword", 1)
or
Code:
obj.OpenDSObject "WinNT://myWinNTDomain","myWinNTDomain\anAdministrator","adminPassword", 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top