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

Question about User Session

Status
Not open for further replies.

pbanacos

IS-IT--Management
Apr 21, 2006
34
US
Hello,

I have a real newbie question about the code below. when I try to display the current user session in Windows it doesn't work. when i run the code it says } expected on line 4. Any help would be deeply appreciated

Thank you,

Paul

var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;

var strComputer = ".";
var objWMIService = GetObject("winmgmts\\.\\root\\cimv2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem");


var enumItems = new Enumerator(colItems);

for (; !enumItems.atEnd(); enumItems.moveNext()) {
var objItem = enumItems.item();

WScript.Echo ("Logged-on user: " +objComputer.UserName);
}
 
I will be running this function from a browser. If that is possible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top