Jump to content

Assign a default printer based on the IP address subnet of client


Recommended Posts

Posted

I've got an interesting question. I currently have a citrix/terminal

services server that publishes applications to 6 branch locations. And to

get around the horrid printer management of citrix, I disabled the printer

autocreation option and setup IP connected printers locally on the citrix

server. So these printers are setup so that they will point to the physical

printer at each of the branch locations using that print server's IP address.

 

Recently I've had a monkey wrench thrown at me in the form of staff rotation

at a few of the branches. My goal now is to create a script that I can place

in the startup folder of each user profile that is housed on the citrix

server that will, based on the client workstation's IP address, will assign

the default printer to that user for the duration of their terminal services

session at the site.

 

Below is some pseudocode for the script.

 

If client workstation IP = 192.168.1.*

Set default Printer = \\tsserver\branch1

Else If client workstation IP = 192.168.2.*

Set default Printer = \\tsserver\branch2

etc....

 

The big thing I am having problems with is figuring out what the variable

would be for a Terminal Services's Client IP address, and the syntax of it.

 

If anyone has any idea of how to code this I would appreciate any help you

could offer. Thanks.

 

-Dan

  • Replies 3
  • Created
  • Last Reply

Popular Days

Guest Jeff Pitsch
Posted

Re: Assign a default printer based on the IP address subnet of client

 

You fail to mention what version of Presentation Server. If it's PS4

and above you can easily do this with Session printers and citrix

policies. In fact, i would recommend taht method over what your doing

right now.

 

Jeff Pitsch

Microsoft MVP - Terminal Server

Citrix Technology Professional

Provision Networks VIP

 

Forums not enough?

Get support from the experts at your business

http://jeffpitschconsulting.com

 

Dan wrote:

> I've got an interesting question. I currently have a citrix/terminal

> services server that publishes applications to 6 branch locations. And to

> get around the horrid printer management of citrix, I disabled the printer

> autocreation option and setup IP connected printers locally on the citrix

> server. So these printers are setup so that they will point to the physical

> printer at each of the branch locations using that print server's IP address.

>

> Recently I've had a monkey wrench thrown at me in the form of staff rotation

> at a few of the branches. My goal now is to create a script that I can place

> in the startup folder of each user profile that is housed on the citrix

> server that will, based on the client workstation's IP address, will assign

> the default printer to that user for the duration of their terminal services

> session at the site.

>

> Below is some pseudocode for the script.

>

> If client workstation IP = 192.168.1.*

> Set default Printer = \\tsserver\branch1

> Else If client workstation IP = 192.168.2.*

> Set default Printer = \\tsserver\branch2

> etc....

>

> The big thing I am having problems with is figuring out what the variable

> would be for a Terminal Services's Client IP address, and the syntax of it.

>

> If anyone has any idea of how to code this I would appreciate any help you

> could offer. Thanks.

>

> -Dan

Posted

Re: Assign a default printer based on the IP address subnet of cli

 

Re: Assign a default printer based on the IP address subnet of cli

 

I am using 4.0 but have not had any luck with the policies. I'll look into

it a little further but if there is anything specific you could recommend

with that route I'm all ears.

 

-Dan

 

"Jeff Pitsch" wrote:

> You fail to mention what version of Presentation Server. If it's PS4

> and above you can easily do this with Session printers and citrix

> policies. In fact, i would recommend taht method over what your doing

> right now.

>

> Jeff Pitsch

> Microsoft MVP - Terminal Server

> Citrix Technology Professional

> Provision Networks VIP

>

> Forums not enough?

> Get support from the experts at your business

> http://jeffpitschconsulting.com

>

> Dan wrote:

> > I've got an interesting question. I currently have a citrix/terminal

> > services server that publishes applications to 6 branch locations. And to

> > get around the horrid printer management of citrix, I disabled the printer

> > autocreation option and setup IP connected printers locally on the citrix

> > server. So these printers are setup so that they will point to the physical

> > printer at each of the branch locations using that print server's IP address.

> >

> > Recently I've had a monkey wrench thrown at me in the form of staff rotation

> > at a few of the branches. My goal now is to create a script that I can place

> > in the startup folder of each user profile that is housed on the citrix

> > server that will, based on the client workstation's IP address, will assign

> > the default printer to that user for the duration of their terminal services

> > session at the site.

> >

> > Below is some pseudocode for the script.

> >

> > If client workstation IP = 192.168.1.*

> > Set default Printer = \\tsserver\branch1

> > Else If client workstation IP = 192.168.2.*

> > Set default Printer = \\tsserver\branch2

> > etc....

> >

> > The big thing I am having problems with is figuring out what the variable

> > would be for a Terminal Services's Client IP address, and the syntax of it.

> >

> > If anyone has any idea of how to code this I would appreciate any help you

> > could offer. Thanks.

> >

> > -Dan

>

Guest Jeff Pitsch
Posted

Re: Assign a default printer based on the IP address subnet of cli

 

Re: Assign a default printer based on the IP address subnet of cli

 

What hasn't worked for you? They are pretty simple and pretty powerful

when used correctly.

 

inside the policies under printing are sessin sprinters. You can assign

printers in there and then apply the policy to users/groups, ip address,

servers, etc. In your case, you'd want IP address. The session

printers are simply another way of mapping printers to a users sessions.

Using this method you can also tell the session which session pritner

will be the default.

 

Jeff Pitsch

Microsoft MVP - Terminal Server

Citrix Technology Professional

Provision Networks VIP

 

Forums not enough?

Get support from the experts at your business

http://jeffpitschconsulting.com

 

Dan wrote:

> I am using 4.0 but have not had any luck with the policies. I'll look into

> it a little further but if there is anything specific you could recommend

> with that route I'm all ears.

>

> -Dan

>

> "Jeff Pitsch" wrote:

>

>> You fail to mention what version of Presentation Server. If it's PS4

>> and above you can easily do this with Session printers and citrix

>> policies. In fact, i would recommend taht method over what your doing

>> right now.

>>

>> Jeff Pitsch

>> Microsoft MVP - Terminal Server

>> Citrix Technology Professional

>> Provision Networks VIP

>>

>> Forums not enough?

>> Get support from the experts at your business

>> http://jeffpitschconsulting.com

>>

>> Dan wrote:

>>> I've got an interesting question. I currently have a citrix/terminal

>>> services server that publishes applications to 6 branch locations. And to

>>> get around the horrid printer management of citrix, I disabled the printer

>>> autocreation option and setup IP connected printers locally on the citrix

>>> server. So these printers are setup so that they will point to the physical

>>> printer at each of the branch locations using that print server's IP address.

>>>

>>> Recently I've had a monkey wrench thrown at me in the form of staff rotation

>>> at a few of the branches. My goal now is to create a script that I can place

>>> in the startup folder of each user profile that is housed on the citrix

>>> server that will, based on the client workstation's IP address, will assign

>>> the default printer to that user for the duration of their terminal services

>>> session at the site.

>>>

>>> Below is some pseudocode for the script.

>>>

>>> If client workstation IP = 192.168.1.*

>>> Set default Printer = \\tsserver\branch1

>>> Else If client workstation IP = 192.168.2.*

>>> Set default Printer = \\tsserver\branch2

>>> etc....

>>>

>>> The big thing I am having problems with is figuring out what the variable

>>> would be for a Terminal Services's Client IP address, and the syntax of it.

>>>

>>> If anyone has any idea of how to code this I would appreciate any help you

>>> could offer. Thanks.

>>>

>>> -Dan


×
×
  • Create New...