Location based terminal server logon script

Posted on 2004-11-29
Medium Priority
Last Modified: 2010-04-13

I have a questions to which I can't seem to find any documentation on the net.

I have a few clients which use terminal services. Currently when a head office user goes to a brach office all his printers are still defaulted to the head office one's as that is his group membership which the currently logon script works off.

What i'd like to achieve is to create a logon script which either grabs the client device name, or client IP address and based on that assigns a set of printers and default printers which apply in this location. This would then mean that it doesn't matter who logs onto the workstation, but only which workstation logs on. If there's some sort of variable in vbs i can use to grab the client device name please let me know! i tried session name which only returns the computer name of the terminal server...

Any help or pointing into the right direction would be an absolute godsend!!

Thanks to all in advance! :-)
Question by:txsolutions
  • 2
LVL 11

Expert Comment

ID: 12702975
Hello txsolutions,

To accomplish this by using a script would be an administrative nightmare.  Each time a printer was deleted, added, or changed, the scripts would have to be modified to reflect that.  I would recommend setting up printer locations.  It detects which site a user is located at and alters the search for printer feature in AD.  When the user want to print, they search AD and only the printers in the site show up.  Of course they are all named with names that clearly identify them.  Here is a link to set it up.



Author Comment

ID: 12703029
Hi Cfairley,

firstly, thanks alot for the quick reply to my question! :-)

The situation is more relative to smaller sites with rather static configurations. They also run a custom application which statically points to printer queues based on the login name. This is of course a problem when that users moves from site to site. One of the things that this application however can do is point to the default printer queue. Thus my thought was, if i set up all terminals with a 3 character prefix per location and then map printers based on that prefix of the terminal i can assign the correct default printer to the user and then this problem is solved.

I do take onboard though the warning of the increased admin overhead when changes to the network occur, but as i said, these are smaller and quite static turn-key type networks which I'm dealing with at the moment. (last printer change for one particular site was back in 2001... :-) )

Any help is very muchly appreciated.

thanks again for the reply cfairley!
LVL 11

Accepted Solution

cfairley earned 2000 total points
ID: 12703095
sorry about that!

Here is are some scripts I found:




After creating the script, you can create a new group policy and link it to various AD sites.  You can enter the script in the Computer Configuration/Windows Settings/Scripts.

Of course, this will not detect by computer name, but you can link it to sites or OUs if your OU structure is based off sites.

I'm off to bed, so I hope this helps some.  Talk to you tomorrow.  Thanks!

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If anyone asked you to network diagram of the internet, it was drawn in the form of a fluffy cloud which further became known as cloud computing. Popularly cloud computing is defined as workloads that run over the internet in a commercial provider’s…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question