Feature: Don't suspend if other users are connected (1 Viewer)

eloo

Portal Pro
January 20, 2005
217
7
43
Aarhus, Denmark
Hi,

I would love to see a checkbox in the Powerscheduler config that said "If other users connected reset timer instead of standby".
Why?
Because I often do remote administration on my HTPC or use SAMBA connected as a different user, and I don't like having to exit MP just to have peace and calm to do my administrative jobs.

I hope it makes sense.
 

sunsetdk

Portal Pro
October 18, 2005
116
3
44
Nordborg
Home Country
Denmark Denmark
Good idea

I often have the same problem. So i would really like the same feature. I hope that when i have had my dot net cause that i'll be able to look into making a plug in he no one have made it before.

Renè
 

eloo

Portal Pro
January 20, 2005
217
7
43
Aarhus, Denmark
Glad to hear Im not the only one. I have been looking around for some code to check number of users logged in, but I can't find it. I should be quite easy to implement.
 

reagan+carter

Portal Pro
September 6, 2006
221
2
Nantes, FR
The NetWkstaUserEnum function lists information about all users currently logged on to the workstation. This list includes interactive, service and batch logons.

Only members of the Administrators local group can successfully execute NetWkstaUserEnum both locally and on a remote server.

Code:
[DllImport("netapi32.dll", CharSet=CharSet.Unicode)]

extern static uint NetWkstaUserEnum(
    string servername, //Pointer to a Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.
    uint level, //Specifies one of the following values to return the level of information provided.
                   //Value	Meaning
                   //0	The bufptr parameter points to a WKSTA_USER_INFO_0 structure.
                   //1	The bufptr parameter points to a WKSTA_USER_INFO_1 structure.
    [Out] out WKSTA_USER_INFO_1[] bufptr, //On return, a pointer to the return information structure is returned in the address pointed to by bufptr.
    uint prefmaxlen, //Preferred maximum length, in 8-bit bytes of returned data.
    out uint entriesread, //Pointer to a DWORD that contains the actual enumerated element count.
    out uint totalentries, //Pointer to a DWORD that contains the total number of entries that could have been enumerated from the current resume position.
    [In, Out] IntPtr resumehandle //Pointer to a DWORD that contains resumehandle, whhich is used to continue an existing search. The handle should be zero on the first call and left unchanged for subsequent calls. If resumehandle is NULL, no resume handle is stored.
);
have fun
 

Users who are viewing this thread

Top Bottom