Jamaica Posted August 24, 2007 Share Posted August 24, 2007 I want to check that the pc is not logged in so I can run some software installations via another process. I guess it might fall into the category of the pc being idle. But I just need the machine to be up and at the three finger solute screen. Can anyone help. I don't even know where to start. Link to comment Share on other sites More sharing options...
weaponx Posted August 24, 2007 Share Posted August 24, 2007 http://www.microsoft.com/technet/sysintern...PsLoggedOn.mspx Link to comment Share on other sites More sharing options...
Jamaica Posted August 24, 2007 Author Share Posted August 24, 2007 Thanks. I appreciate that. I'll give it a try.http://www.microsoft.com/technet/sysintern...PsLoggedOn.mspx Link to comment Share on other sites More sharing options...
Jamaica Posted August 24, 2007 Author Share Posted August 24, 2007 Your suggestion was definately helpful but is there a way to get a similar result with an autoit script. Much like the results of psloggedon.exe I want to detect that no one is logged in, then trigger an installation. I have the installation script ready to go but have no clue on addressing the most important piece. Thanks. I appreciate that. I'll give it a try. Link to comment Share on other sites More sharing options...
martin Posted August 24, 2007 Share Posted August 24, 2007 Your suggestion was definately helpful but is there a way to get a similar result with an autoit script. Much like the results of psloggedon.exe I want to detect that no one is logged in, then trigger an installation. I have the installation script ready to go but have no clue on addressing the most important piece. Perhaps something along these lines. Global $objWMIService = 0 Global $strComputer,$colEvents,$np $strComputer = "." If $objWMIService = 0 Then $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colEvents = $objWMIService.ExecQuery _ ("Select * from Win32_PerfRawData_PerfNet_Server") For $objClass in $colEvents msgbox(0,"Serversession",$objClass.ServerSessions) Next Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Jamaica Posted September 24, 2007 Author Share Posted September 24, 2007 This piece of script shows me the current logged in user for my pc. How do I get it to read a remote pc registry to test the setting. I think this could be the setting I need to validate if "anyone" is logged on to a remote workstation before I run my anti virus installation and reboot. $value = RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\", "AltDefaultUserName") Msgbox(64, "Value", $value) Perhaps something along these lines. Global $objWMIService = 0 Global $strComputer,$colEvents,$np $strComputer = "." If $objWMIService = 0 Then $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colEvents = $objWMIService.ExecQuery _ ("Select * from Win32_PerfRawData_PerfNet_Server") For $objClass in $colEvents msgbox(0,"Serversession",$objClass.ServerSessions) Next Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now