Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Show windows username and the win domain

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1147
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Show windows username and the win domain
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Show windows username and the win domain - 7/15/2004 4:53:38 AM   
  ALex-b

 

Posts: 1
Score: 0
Joined: 7/15/2004
From:
Status: offline
Hi
I wanna show the username and the win domain that the user of my webinterface is loged in to on a webinterface (with executing a vbs with php)
I found this script somewere:
strComputer = "RemoteComputer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next

can i use that for my purpose when I try it i get an error message:
Remoteservercomputer doesnt exist.......:'GetObject'


thanks for your help

Alex
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Show windows username and the win domain Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts