red79bronco Posted April 7, 2008 Share Posted April 7, 2008 I need to check the status of a computer before activating a script. I am executing an AutoIT script using psexec on a list of computers. How can I check the remote computer to see if the computer is at a windows logon screen? I thought I could check a window title, and exit the script if the Welcome to Windows text was in the screen, but that does not seem to be the case. Link to comment Share on other sites More sharing options...
ptrex Posted April 7, 2008 Share Posted April 7, 2008 @red79bronco A simple check on wether he/she is running the "Explorer.exe" Process will do. If not running he/she will be at the logon window. You can do this using WMI. There are lot"s of examples on how to do a remote check on a process. I hope this get's you going. regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
red79bronco Posted April 7, 2008 Author Share Posted April 7, 2008 thanks for pointing me in the right direction. Regards, red79bronco Link to comment Share on other sites More sharing options...
red79bronco Posted April 7, 2008 Author Share Posted April 7, 2008 thanks, again, for the nudge. If ProcessExists("explorer.exe") Then ;Perform some action for logged on user Else ;Wait for user to log on EndIf Regards, red79bronco Link to comment Share on other sites More sharing options...
exodius Posted April 8, 2008 Share Posted April 8, 2008 thanks, again, for the nudge.If ProcessExists("explorer.exe") Then ;Perform some action for logged on userElse ;Wait for user to log onEndIfRegards,red79broncoYou could also have a script that basically does a batch run of pslist (in the same pstools as psexec) for that list of computers and parse out your results then take action based on it... Link to comment Share on other sites More sharing options...
spudw2k Posted April 8, 2008 Share Posted April 8, 2008 (edited) Another way, using WMI, is to query the UserName property from the Win32_ComputerSystem class. $host = "." $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $host & "\root\cimv2") $colItems = $objWMIService.ExecQuery ("SELECT UserName from Win32_ComputerSystem") For $objItem in $colItems msgbox(0,"",$objItem.UserName) Next Name of a user that is logged on currently. This property must have a value. In a terminal services session, UserName returns the name of the user that is logged on to the consolenot the user logged on during the terminal service session. Edited April 8, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
exodius Posted April 8, 2008 Share Posted April 8, 2008 Another way, using WMI, is to query the UserName property from the Win32_ComputerSystem class. $host = "." $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $host & "\root\cimv2") $colItems = $objWMIService.ExecQuery ("SELECT UserName from Win32_ComputerSystem") For $objItem in $colItems msgbox(0,"",$objItem.UserName) Next That'll work as long as the computer is pingable, otherwise you're going to have a very long timeout on that WMI call... Link to comment Share on other sites More sharing options...
spudw2k Posted April 18, 2008 Share Posted April 18, 2008 That'll work as long as the computer is pingable, otherwise you're going to have a very long timeout on that WMI call...Resolvable, not pingable. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF 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