Michael Harris (MVP)
Guest
|
Posted:
Tue Jan 04, 2005 7:01 am Post subject:
Re: Help with Script please - Local Users and groups |
|
|
Luke Ross wrote:
| Quote: | I am running the following script located in MS Script samples below:
http://www.microsoft.com/technet/scriptcenter/scripts/ds/local/groups/logpvb05.mspx
I would like the strComputer to equal the current machine it is being
ran on.. When using a system variable like %COMPUTERNAME%, the script
fails.
I am new to scripting and was wondering if there was a way to modify
the script to run on the current machine. And not just by specifying
it manually.
|
strComputer = "."
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
Wscript.Echo objGroup.Name
For Each objUser in objGroup.Members
Wscript.Echo vbTab & objUser.Name
Next
Next
| Quote: |
-----------------------------------------
strComputer = "%COMPUTERNAME%"
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
Wscript.Echo objGroup.Name
For Each objUser in objGroup.Members
Wscript.Echo vbTab & objUser.Name
Next
Next
-----------------------------------------
Thanks,
Luke Ross
Washington County, OR
|
--
Michael Harris
Microsoft MVP Scripting |
|