Re: Group Policy executes prior User login script execute
- From: Kurt <kurtl@xxxxxxxxxxxxxxxxx>
- Date: Sun, 31 Dec 2006 17:14:10 -0800
Adnank5 wrote:
Hi Mark,
Thanks for your reply, but my question is still there as per your post
and the hirarchical way of running scripts :
1. script from User Settings (netlogon) executes, finishes
2. Scripts from OU in their hirarchical/inheritate way
executes (one by one, next starts when first finishes
3. explorer.exe starts an user environment
on OU finance all users will be assinged their default printer
including those who would be assigned default printer other than
defined in OU finance for that reason I attached user login script
thinking that the hierachy would be like following :
1) Group Policy login script
2) User profile login script
3) Explorer
but user login script running first thus they are again getting
assigned the same printer like others.
I don't see a way to control it !!!!!!!
You can use the %username% and/or %computername% variables to control the flow of the batch file or wsh script. I have a jscript batch processor ("kshell") that I wrote for myself that interprets simple script-like files (.kss files) without having to use the long-winded Windows API calls. An example script that does what you want might look like this:
if username == user1 skip 4 //skips the next 4 lines
if username == user2 skip 3
if username == user3 skip 2
netprt \\server1\printer1
skip 1
netprt \\server2\printer2 //skips to here
exit
you can call it with a one-line batch file:
cscript \\my-dc-01\scripts\kshell.js \\my-dc-01\scripts\logon.kss
The first 3 lines check to see if the user logged in is user1, 2 or 3. If the user is one of those three, the script installs printer2 on server2. Otherwise it installs printer1 on server1. With printers, it might make more sense to control which printer is installed based on the computername rather than username.
I have commands for common functions like creating/copying/deleting files and directories, mapping drives, adding routes, installing network printers, putting up message boxes and allowing the button selected to control program flow. It's very rudimentary as you can see, but you can add or modify it to suit your needs. As it is, it should do what you want. It's old, (wsh 2.0) so it should work on all versions of windows from 2000 up without having to install a wsh update. I also have basic documentation. If you want a copy, email me (remove "nospam" from the email address) and I'll send it to you. Offered as-is of course. Use at your own risk. If you add anything useful (like "netsh" support), please send me an updated copy.
....kurt
.
- References:
- Prev by Date: Re: Group Policy executes prior User login script execute
- Next by Date: Software restriction
- Previous by thread: Re: Group Policy executes prior User login script execute
- Next by thread: Software restriction
- Index(es):
Loading