Group Policy executes prior User login script execute

  • Thread starter Thread starter Adnank5
  • Start date Start date
A

Adnank5

Hi Folks,

I have a group policy on top of OU finance for drive mapping and
setting default printer but few users have default printer different
from defined at OU level, hence I have attached user profile login
script for those users but the nightmare is both of the scripts
executes same time and group policy login script undo the changes of
user profile login script.

And at the same time i dont want to seperate those users from OU as
they all belong to the same OU finance, is there anyway I can let wait
user login script wait until group policy login script finish ?????????

Any help would be appreciated, many thanks in Advance.
 
Hi,
[...] hence I have attached user profile login
script for those users but the nightmare is both of the scripts
executes same time and group policy login script undo the changes of
user profile login script.

CompConf\AdmTempl\System\Scripts
"Run Scripts synchronously" = Activate

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

Mark
 
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 !!!!!!!
 
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 !!!!!!!
 
Adnank5 said:
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
 
Back
Top