Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Determine Which Account a Script is Running UnderContent of Determine Which Account a Script is Running Under.vbsMD5 Hash: 2E4E5E6860517DFBC13C009688527654 |
||
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where " & _ "Name = 'cscript.exe' or Name = 'wscript.exe'") For Each objProcess in colProcessList If InStr(objProcess.CommandLine, "test.vbs") Then colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain) Wscript.Echo "This script is running under the account belonging to " _ & strUserDomain & "\" & strNameOfUser & "." End If Next | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |