Re: connecting to printers at PC startup



Yes, you're right.
I'll try it tomorrow.
Thanks a lot.

"Chris M" <Nobody@xxxxxxxxxxxxxxx> wrote in message
news:ffn7cf$joj$2@xxxxxxxxxxx
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.


.



Relevant Pages

  • Re: Xcopy not working in startup script
    ... This is a basic batch file script that I am ... deploying through group policy in the startup script to copy ... it works fine on it's own, but when deployed through group policy it ... the permissions of the computer object elsewhere in the domain. ...
    (microsoft.public.windows.server.general)
  • Re: Access XP Workstations via RWW
    ... One trick I've used is creating a marker file as the last step of the logon script if it is successful. ... Since all your users are a member of the "Remote Web Workplace Users" security group, you might be able to create startup script that adds the domain "Remote Web Workplace Users" group to the local "Remote Desktop Users" group on each PC. ... While this example appears to be for Windows 2000, I suspect you can use the Group Policy Management module in SBS 2003 Server Management to accomplish the same thing. ...
    (microsoft.public.windows.server.sbs)
  • Re: Restricted group
    ... Startup script would work well. ... user will be added to the administrators group for the domain. ... > This cannot be done with existing Group Policy extensions. ...
    (microsoft.public.win2000.group_policy)
  • Re: GPO for assigning printers
    ... connecting a printer in a Startup Script won't do anything useful. ... Although network printer connections are per user, you can use the PrintUI command to deploy printers to all users on a computer. ... Although you could do this in a Startup Script, the printer connection is persistent, so you only have to execute the command once per printer per computer, not every time the computer starts, so using it in a Startup Script is somewhat overkill. ...
    (microsoft.public.windows.group_policy)
  • Re: Run script with elevated privileges
    ... add it as a startup script. ... The script reads the serial number from the system BIOS ... problem is rights, so I'm wondering if there is a way to make a script ... as opposed to one imposed through group policy. ...
    (microsoft.public.scripting.wsh)