RE: Set default printer based on room location



Hi,

I do this all the time. All my users roam so I have printers based on Room
Location instead of User.

Just so you know, Network Printers are loaded in the "users profile".
Therefore IF you have roaming profiles, everytime a users logs into a machine
and a printer is added, it will "add" to the Users profile as well. This can
be a problem so you need to set defaults.

Because my users roam around, I have printers setup via computer. This is
done with a "Startup Script" Batch file or with KIX Script. I found that if
you want to install printers via computer, you can't use a VBScript because
for some reason the VBengine doesn't start before the scripts run. Anyway, I
have never got a printer VBScript to run on startup.

Before doing any of this, I dedicate a Printer Server and install the
Printers (from IP) onto the Print Server and then share them.

I use both KIXscript (pretty cool but takes a bit to learn) and the basic
batch file. I will list the batch file here.

The command is
rundll32 printui.dll,PrintUIEntry /in /q /n "\\server\printersharename"
(installs)
rundll32 printui.dll,PrintUIEntry /y /q /n "\\server\printersharename" (sets
default)

If you go to the Command line and type rundll32 printui.dll,PrintUIEntry /?
it will pop up with a list of all thethings you can do with this command.

I have 2400 Users and I use mandatory profiles so this works great.

Basically I put this batch file in the Netlogon share and assign it as a
computer startup script in Active Directory GP on the OU containing the
computers.

However, I have run into a problem with XP. With 2000, just adding the
"printer" to the "Computer" shows the printer in the My Printers list.
However, with XP this isn't the case for some reason.

For the sake of XP machines, In the Same GPO above where the Startup Script
is, I also enable "group policy loopback mode with MERGE" and then in the
Users section of the Same GPO I set the above "startup script" as a "login
Script". This means it adds this to the Users regular GP when they are
logged into this computer. Then the printer loads again as a "login" script
for the user.

The advantages to this is the printers are now automatically assigned to the
computers and not the users. The "disadvantage" of this is IF you decide to
rename or delete the printer off the network, then you have to run the
script: rundll32 printui.dll,PrintUIEntry /dl /q /n
"\\server\printersharename" to delete the printer from the computer. (use
/dl if the printer name is not valid anymore, or use /dn if the printer name
is still valid)

Would be nice if you could just add the printer in AD and then assign to a
computer. Maybe in the next version of Server.

Cheers,

Lara


"Ozan Pakyuz" wrote:

> Hi All,
>
> I was just wondering if there is a way to set a printer at logon based on
> the room the person is logging onto the pc at.
>
> For Example:
>
> We have 4 IT suites, each suite comprises of 35 pc's and one network
> printer, if JoeA logs on to a PC in suite A the network printer A is assigned
> but then if he goes across to suite B network printer b is assigned.
>
> Within AD I have setup an OU with the various rooms underneath it (Room1,
> Room2,etc..) and was wondering if there is a way that a printer can be
> applied via GPO?
>
> I have looked for some kind of script but no joy.
> --
> Regards,
>
> Ozan Pakyuz
> OP Software (UK) Limited
>
>
.



Relevant Pages

  • Re: Help - How to use wmi to set up local printer share ?
    ... > 'Local and Network bits are set, this indicates a network printer. ... > Now if I manually shareboth printers and run the script again ... >>which flags are present? ...
    (microsoft.public.win32.programmer.wmi)
  • 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: Printer Settings
    ... Here is a script which sets various printer attributes using WMI. ... Local and Network bits are set, this indicates a network printer. ... > Our customers currently have the option to associate reports with report ...
    (microsoft.public.win32.programmer.wmi)
  • Re: VBS Logon Script Help
    ... script would error saying printer does not exist. ... ' VBScript to - Network Printer ... Dim objNetwork, strUNCPrinter ...
    (microsoft.public.scripting.vbscript)
  • Torgeir Bakken
    ... I have been trying to get this script ... I am using windows 2000 professional clients and a windows 2003 Enterprise ... If computername is member of group "Finance department" then ...
    (microsoft.public.windows.server.scripting)