Re: connecting to printers at PC startup
- From: Chris M <Nobody@xxxxxxxxxxxxxxx>
- Date: Wed, 24 Oct 2007 11:38:34 +0100
tree leafs wrote:
Hi,
I want to use a group policy to have PCs automatically connecting to specified printer(s) when the PCs start up. This is what I did:
1. create an OU and move the targeted PC(s) into it;
2. cretae a group policy object and link it to the OU just created. In the GPO, in computer node -> windows -> script -> startup, add a vbs script like this:
set objNet = CreateObject("Wscript.Network")
PrinterShare="\\server\sharedprinter"
objNet.AddWindowsPrinterConnection PrinterShare
3. restart the targeted PC. The startup script gets executed - I am sure of this because if I make any mistakes in the script a warning message will pop up. However, the printer does not get connected even if the script executed successfully. What's wrong?
4. If I move a user in to that OU and move the script from computer node's startup script to user node's logon script. Then logon as that user, the printer gets connected. However, this is not exactly what I wanted. My purpose is to connect printers according to PC rather than user. How can I do that?
You can't do it in a startup script as you have found out - the reason for that is that connecting to a shared printer is done on a 'per user' basis (try it: log in as a user, map a printer. Log on as someone else and the printer will no longer be there. Log back on as the original user and the printer is still there). A startup script runs in the context of the local SYSTEM account. Even if the printer mapped correctly (which it probably wouldn't), it would disappear when someone else logged on.
Again, as you have found out, it will work in a login script. This is because the login script runs in the context of the user who is logging on.
Since you don't want to stick your user accounts in the OU where the policy resides, the answer is to use loopback processing on the GPO where the login script is.
http://support.microsoft.com/kb/231287
This will cause the user configuration to apply even though the user account object is not in the same OU as the one where the policy is applied.
Hope this helps.
--
Chris.
.
- Follow-Ups:
- Re: connecting to printers at PC startup
- From: tree leafs
- Re: connecting to printers at PC startup
- References:
- connecting to printers at PC startup
- From: tree leafs
- connecting to printers at PC startup
- Prev by Date: connecting to printers at PC startup
- Next by Date: Re: connecting to printers at PC startup
- Previous by thread: connecting to printers at PC startup
- Next by thread: Re: connecting to printers at PC startup
- Index(es):
Relevant Pages
|