sb1920alk Posted May 28, 2009 Share Posted May 28, 2009 I'm trying to get the idle time of a remote computer. I'm leaning towards one script with _Timer_GetIdleTime() writing to a temp file, compiled and called from a second script with psexec.exe -c..., and reading and deleting the temp file, but it's ugly and slow. Any suggestions? Link to comment Share on other sites More sharing options...
herewasplato Posted May 29, 2009 Share Posted May 29, 2009 I'm trying to get the idle time of a remote computer. I'm leaning towards one script with _Timer_GetIdleTime() writing to a temp file, compiled and called from a second script with psexec.exe -c..., and reading and deleting the temp file, but it's ugly and slow. Any suggestions?I don't know of a better way, but maybe one of the WMI gurus can think of something.Here is a bump. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 29, 2009 Share Posted May 29, 2009 I'm trying to get the idle time of a remote computer. I'm leaning towards one script with _Timer_GetIdleTime() writing to a temp file, compiled and called from a second script with psexec.exe -c..., and reading and deleting the temp file, but it's ugly and slow. Any suggestions?I don't know a way to read that parameter directly from a remote machine (ala WMI, etc.). But I wouldn't bother with a file either. If the Remote Registry service is up and you have the right permissions, just have the remote script update a registry value. You can then read that remotely with RegRead(). From the help file under RegRead(): It is possible to access remote registries by using a keyname in the form "\\computername\keyname". To use this feature you must have the correct access rights. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
herewasplato Posted June 3, 2009 Share Posted June 3, 2009 (edited) I don't know of a better way, but maybe one of the WMI gurus can think of something.Here is a bump.http://www.autoitscript.com/forum/index.ph...st&p=690796edit: maybe some ideas in that code even if it is just for time Edited June 3, 2009 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Tec Posted June 3, 2009 Share Posted June 3, 2009 (edited) I think there is no way over wmi query. I play with Win32_PerfFormattedData_PerfOS_Processor and PercentProcessorTime but i dont think you can get the real idle time. Dont know what you want to do, but you can run a schedule task that start when Computer is idle for x minutes. SCHTASKS.exe /Create /S xxx /RU "Administrator" /RP xxx /SC ONIDLE /I 5 /TN "IdleLogoff" /TR "shutdown -l -f" Look at SCHTASKS.exe /Create /help Or setup screensaver and check remote process if screensaver is running. Edited June 3, 2009 by Tec Link to comment Share on other sites More sharing options...
sb1920alk Posted June 16, 2009 Author Share Posted June 16, 2009 I don't know a way to read that parameter directly from a remote machine (ala WMI, etc.). But I wouldn't bother with a file either. If the Remote Registry service is up and you have the right permissions, just have the remote script update a registry value. You can then read that remotely with RegRead(). From the help file under RegRead(): File or registry...either way, the bottleneck is psexec. 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