Sign in to follow this  
Followers 0
sb1920alk

Remote Idle Time

6 posts in this topic

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?

Share this post


Link to post
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]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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=690796

edit: maybe some ideas in that code even if it is just for time

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Tec

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0