Jump to content

Number of Logins Per Day


Blahages

Recommended Posts

Like I said, I think it would be best to keep the configuration strictly in HKLM. If the settings don't exist in HKLM then it should exit. That would force proper configuration of the app for each user. But that's just the way I would do it... :)

Well, in this case HKLM always has precedance... so it's almost the same.

Link to comment
Share on other sites


jcarle.

The attachment now includes a folder with 5 files:

SessionManager.exe - The program executable

Install.bat - A batch file to copy the executable to C:\Windows\system32

Remove.bat - A batch file to remove the executable from C:\Windows\system32

Add To Startup.reg - A registry file which you can import to set the session manager to run from the current user

Remove From Startup.reg - A registry file which you can import to remove the session manager from the current user

Basically, if you throw this on say a USB stick or something, all you need to do after is run Install.bat to copy the program file, login as the user you want to limit, run Add To Startup.reg. Logout and login into any other additional users you want to limit and run Add To Startup.reg again.

does your latest session manager iteration download still work as you discussed to me earlier.

Iin other words do I just follow the steps as above but using this latest download or are we still a 'work in progress'. this is generating much interest in all my friends who have kids who dont know when enough pc is enough - hence my desire to get this thing working as you originally posted.

Many thanks to all you brainheads working all this out.

Cheers guys

:thumbup

Edited by Railman5
Link to comment
Share on other sites

I'm almost done with the configuration utility. It currently won't work in a domain environment (because I've specifically excluded domain users when it parses the users). I had to figure out how I was going to handle enumerating the users and then how I was going to prompt for the information. Now that I've figured that out I need to update it to actually write the registry entries.

Can someone verify that REG.EXE does exist on XP Home Edition? I'm pretty sure it does...I just don't have access to an XP Home machine right now to check.

Link to comment
Share on other sites

does your latest session manager iteration download still work as you discussed to me earlier.

Iin other words do I just follow the steps as above but using this latest download or are we still a 'work in progress'. this is generating much interest in all my friends who have kids who dont know when enough pc is enough - hence my desire to get this thing working as you originally posted.

Many thanks to all you brainheads working all this out.

Cheers guys

:thumbup

Let's just wait and see what nmX.Memnoch has brewing. If he's finished his installer or not...

Edited by jcarle
Link to comment
Share on other sites

Errr... :whistle:

Back to the task at hand. Is there any possiblity of changing the LoginsPermitted and SessionLength keys to REG_SZ as opposed to REG_DWORD? If not then I may end up having the script convert the decimal input to hex. Not that I can't do that...but I'd like to preserve what little of my sanity I still have left. :D

It's going to be at least one more night. I know how I'm going to handle most everything with the configurator now...I'm just too spent to finish up the coding tonight. :(

Edited by nmX.Memnoch
Link to comment
Share on other sites

Errr... :whistle:

Back to the task at hand. Is there any possiblity of changing the LoginsPermitted and SessionLength keys to REG_SZ as opposed to REG_DWORD? If not then I may end up having the script convert the decimal input to hex. Not that I can't do that...but I'd like to preserve what little of my sanity I still have left. :D

It's going to be at least one more night. I know how I'm going to handle most everything with the configurator now...I'm just to spent to finish up the coding tonight. :(

It has to remain REG_DWORD.

As for Hex conversion:

Func toHex($dec)
If $dec < 16 Then
Return Hex($dec,1)
Else
Return toHex($dec/16) & toHex(Mod($dec,16))
EndIf
EndFunc

And from Hex to Decimal:

$dec = Dec("49E9AB20")

Link to comment
Share on other sites

Turns out the latest version of AutoIt has a built in function for hex conversion... :D

$H = Hex($DEC)

Edit:

If you're going to use that to write a registry value, then you have to add the "0x" to the beginning:

$H = "0x" & Hex($DEC)

Edited by nmX.Memnoch
Link to comment
Share on other sites

Here it is...it's only been tested on my machine so I hope it doesn't disappoint. :)

Instead of running in each user's "Run" key, I changed it to a StartUp shortcut. There's a local group created by Setup. When a user is configured, the user is added to this group. The StartUp shortcut checks to see if the user is a member of this group. If so, then it starts SessionManager. If not, it just exits.

Uninstalling the application completely removes all user configurations and the local group.

Domain accounts aren't supported by the configurator at this time so manual configuration would still be required.

Also, keep in mind this is jcarle's application...I only created the installer and configurator. :)

Download here

Here are some screenshots:

01-config_user.gif

02-config_user_sessions.gif

03-config_user_session_lenth.gif

04-config_user_confirmation.gif

05-config_shortcut.gif

06-startup_shortcut.gif

07-user_reconfig.gif

08-user_remove_config.gif

09-user_group.gif

10-user_group_members.gif

Edited by nmX.Memnoch
Link to comment
Share on other sites

First off... awesome. Thanks Memnoch. Great work. :)

Instead of running in each user's "Run" key, I changed it to a StartUp shortcut. There's a local group created by Setup. When a user is configured, the user is added to this group. The StartUp shortcut checks to see if the user is a member of this group. If so, then it starts SessionManager. If not, it just exits.
Which startup is this created in? All Users or the individual user's account? Just curious... wondering if the "restricted" user can just right-click delete the shortcut in the startup account.
Also, keep in mind this is jcarle's application...I only created the installer and configurator. :)
So in otherwords, send the s*** my way, eh? :P

I wonder what ever happened to the original poster... haven't seen him reply in this thread, which ironically, was the reason for developing the session manager.

Link to comment
Share on other sites

This looks excellent... great work both of you. This is the kind of stuff that happens when MSFN's best put their minds together. :D
Thanks...we aim to please. :)
First off... awesome. Thanks Memnoch. Great work.
Thanks and you're welcome. :)
Instead of running in each user's "Run" key, I changed it to a StartUp shortcut. There's a local group created by Setup. When a user is configured, the user is added to this group. The StartUp shortcut checks to see if the user is a member of this group. If so, then it starts SessionManager. If not, it just exits.
Which startup is this created in? All Users or the individual user's account? Just curious... wondering if the "restricted" user can just right-click delete the shortcut in the startup account.
It's in the All Users so a regular/restricted user can't delete it. The Configurator also won't run if a non-admin account attempts to run it. In other words, the account MUST be in the Administrators group to run the Configurator, otherwise it'll give a warning message and exit. Here's the code for the StartUp script (it's compiled into an executable by AdminScriptEditor):

If InGroup("@WKSTA\SessionManager")
Shell '%COMSPEC% /C START "" "%PROGRAMFILES%\SessionManager\SessionManager.exe"'
EndIf

Thinking about it I should make a slight modification to that so that it checks for the existance of the configuration key for that user as well. It's another level of error checking that may not be necessary, but I'll add it anyway.

The installer also sets custom permissions on %PROGRAMFILES%\SessionManager and all files within it so that a regular user can't edit or delete anything in it (everything is compiled into EXE's anyway).

Also, keep in mind this is jcarle's application...I only created the installer and configurator.
So in otherwords, send the s*** my way, eh? :P
Not at all...I just don't want to take credit for something that isn't mine. :)
I wonder what ever happened to the original poster... haven't seen him reply in this thread, which ironically, was the reason for developing the session manager.
I noticed that as well...but other people seemed interested anyway. Edited by nmX.Memnoch
Link to comment
Share on other sites

Done. The StartUp Utility has been updated for additional error checking. The user must be completely configured for it to start (the account must exist in the SessionManager user group and the registry entries must exist).

Download Here

If you've already downloaded and installed you can simply install over the previous installation.

If InGroup("@WKSTA\SessionManager") And KeyExist("HKLM\SOFTWARE\SessionManager\@WKSTA\@USERID")
Shell '%COMSPEC% /C START "" "%PROGRAMFILES%\SessionManager\SessionManager.exe"'
EndIf

jcarle: Let me know if you want a copy of all the source scripts.

Edited by nmX.Memnoch
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
  • Recently Browsing   0 members

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