Jump to content

Remote Idle Time


Recommended Posts

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

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

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

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 by Tec
Link to comment
Share on other sites

  • 2 weeks later...

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():

:D

File or registry...either way, the bottleneck is psexec.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...