alwaysZeroHour Posted June 20, 2007 Posted June 20, 2007 Hii 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;#entry285943Cheers and keep up the good work all. Z
KenE Posted June 22, 2007 Posted June 22, 2007 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.Hii 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;#entry285943Cheers and keep up the good work all.
KenE Posted June 25, 2007 Posted June 25, 2007 (edited) 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 June 25, 2007 by KenE
lod3n Posted June 25, 2007 Posted June 25, 2007 Try this: Originally from here: http://www.autoitscript.com/forum/index.php?showtopic=47314 [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now