Question Locked

what is the line?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I know that the object for searching Windows 2000 is WinNT when writing a batch file such as this piece:

Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")

what would I use in place of that for Windows Small Business Server 2003

2 replies

by dan.cox

Not sure about batch file but it is easy from VBScript file.
Try this.

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_ComputerSystem")

For Each objItem in colItems
Wscript.Echo objItem.UserName
Next

This discussion is closed to new replies.