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

Syntax problem

Status
Not open for further replies.
Joined
May 11, 2004
Messages
37
Location
US
I am trying to use an input box to enter a value. I need a username to be entered and then this username (strUser) should be used in line 5 of the script below. I can't get this to work. Can someone show me the correct syntax?

Thanks very much.

strComputer = "rich"
strUser = InputBox("Enter Username: ")
Set objGroup = GetObject("WinNT://" & strComputer & "/customers,group")
Set objUser = GetObject("WinNT://" & strComputer & "/strUser,user")
objGroup.Add(objUser.ADsPath)
 
strComputer = "rich"
strUser = InputBox("Enter Username: ")
Set objGroup = GetObject("WinNT://" & strComputer & "/customers,group")
Set objUser = GetObject("WinNT://" & strComputer & "/[red]" & strUser & "[/red],user")
objGroup.Add(objUser.ADsPath)

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Works like a charm! This problem was driving me crazy. Thanks SO much!!

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top