Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
January 29, 2006
If you retrieve a script argument using the WinNT provider, you can use the Class property of the object to determine what type of object the argument was.
If your c:utiltest0.vbs script contains:
Dim objArguments, strDomainUser, ClsSet objArguments = Wscript.ArgumentsIf WScript.Arguments.Count = 0 then Wscript.QuitstrDomainUser=objArguments(0)Cls="NOT FOUND"On Error Resume Next Set objUser = GetObject("WinNT://" & strDomainUser ) Cls=objUser.ClassWscript.Echo
" & strDomainUser &
" & ClsWscript.Quit
Then see the following:
cscript //nologo c:utiltest0.vbs "JSIINC/Domain Admins""JSIINC/Domain Admins" Groupcscript //nologo c:utiltest0.vbs "JSIINC/Jerry""JSIINC/Jerry" Usercscript //nologo c:utiltest0.vbs "JSIINC/JSI001""JSIINC/JSI001" Computercscript //nologo c:utiltest0.vbs "JSIINC""JSIINC" Domain
You May Also Like