Location based terminal server logon script

Posted on 2004-11-29
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
    LVL 11

    Expert Comment

    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

    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

    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

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    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…
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now