Jump to content
Sign in to follow this  
alwaysZeroHour

Logon/logoff exe's

Recommended Posts

alwaysZeroHour

Hi

i have a logon and logoff exe that are defined in active directory group policy (user log on/log off).

If a user log's on quickly though and logs off quickly (before the program finishes) the program seems to get killed before it finishes running.

Does anyone have any ways to help prevent this?

The user logged is a limited account.

I have looked at the following but have not implemented yet:

http://www.autoitscript.com/forum/index.ph...mp;#entry285943

Cheers and keep up the good work all.


Z

Share this post


Link to post
Share on other sites
KenE

You could write a GINA stub dll. This dll handles logon/off events for WinNT, 2k, and XP. This will not work on Vista. You'd need a C++ compiler... Microsoft VC2005 Express is available free. See: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ for that. Another option is a winlogon notification package. Do a little bit of reading on either of these. Both options give you the ability to delay logon/off until your compiled script exits. You can (using a GINA stub) even run your script before the user shell loads. There are examples included in the required SDK for the compiler mentioned above. I really suck at C++, but I managed to get a stub written that will execute and pass some command line variables (username) to a compiled AutoIt script on logon. MAKE SURE YOU KNOW HOW TO PUT THE OLD GINA.DLL BACK IF YOU SCREW SOMETHING UP! In XP, you can usually boot in safe mode to change the registry back to allow the system to boot normally again, but don't rely on that.

Hi

i have a logon and logoff exe that are defined in active directory group policy (user log on/log off).

If a user log's on quickly though and logs off quickly (before the program finishes) the program seems to get killed before it finishes running.

Does anyone have any ways to help prevent this?

The user logged is a limited account.

I have looked at the following but have not implemented yet:

http://www.autoitscript.com/forum/index.ph...mp;#entry285943

Cheers and keep up the good work all.

Share this post


Link to post
Share on other sites
KenE

Here's a simple GINA stub. Move the .dll to your C:\Windows\System32 directory. Within that directory, create a directory called 'ginastub'. Place a compiled AutoIt script named 'ginastub.exe' there. You should now have an AutoIt compiled script at: 'C:\Windows\System32\ginastub\ginastub.exe'. The GINA stub will pass the following in the command line: LOGOFF, SHUTDOWN, and LOGON [userName]. (Use $CmdLineRaw or $CmdLine[1], etc.) You'll then need to edit the registry to add the new GINA dll.

Create the following value under 'HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon'.

Value Name: GinaDLL

Value Type: REG_SZ

Value Data: "GinaStub.dll"

Exit regedit and reboot. Be sure to have rescue disks, etc. BEFORE doing this. I take NO RESPONSIBILITY for any bugs that may damage your system! If you would like the C++ source, please let me know. I'm using Visual C++ 6.0 with the Windows 2003 platform SDK libraries.

Edited by KenE

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.