Solved

Terminal server printer mapping.

Posted on 2006-10-24
6
535 Views
Last Modified: 2010-04-18
I'm trying to figure out how to apply a login script to map printers on a terminal services session based on the OU membership of system initiating the connection.  Like  a script that will delete all the current printers and map only the ones relevant to the OU that the client system is in.

Is this doable through kixtart?    
0
Comment
Question by:nstd-sts
  • 3
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Shift-3
Comment Utility
This PAQ has information on doing this with VBScript:
http://www.experts-exchange.com/Networking/WinNT_Networking/Q_21261512.html
0
 
LVL 1

Author Comment

by:nstd-sts
Comment Utility
Thanks, I'm trying to stay away from vb but I might not have a choice, I'll see if any one else responds and if they don't I'll start testing.
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
Well the script will run as the user so could you not apply one (different) script to each OU the users are in, presumably in addition to any main ones for drive mappings etc?  Depends how many people and OU's we are talking here I usppose.  If not you'll need to identify the user's OU using something like the above.  
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:nstd-sts
Comment Utility
Right, I probably should have put more info in the original post.  

We can't tie the printer mappings to the user OU's because the users work between the labs.  There's a lot of handholding with our users and many of them click "print" and never look to see where it's going to be printed.  A print being misrouted to a different lab isn't the end of the world but it's a significant security risk in the eyes of our underwriters.  As it stands on the workstations right now I've got them all in OU's corresponding to their location.  Each OU has a script that maps the printer and sets a default so even the people who need to be handheld won't misroute the print.  As they move between labs their default printer changes with each move.  I'm wracking my brain trying to figure out how to come up with a script that can identify the OU that the client workstation is in and then choose the appropriate printer script.  Drive mappings are done through a main script that maps locations based on group membership and in some cases we make custom scripts for a few dozen people.

I'm pretty new to scripting to begin with and I've found kixtart infinitely easier than anything else so I've started with that.  But, if I must vb it I'll do that since it will be mainly for the terminal servers.
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
Comment Utility
I'm not familiar with kixstart, but here are the general steps you could use:

1. Get the client computername from the CLIENTNAME variable.  In a batch script this is easy as echo %clientname%.  In vbscript you could do it like this:

Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set objShell = WshShell.Environment("VOLATILE")
strClientName = objShell("CLIENTNAME")

2. Query Active Directory to determine which OU the computer belongs to.  In vbscript you would use something similar to the script from this article:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct05/hey1013.mspx

but replacing
WHERE objectCategory='user'"
with
WHERE objectCategory='computer'"
and adding a comparison to see if objRecordSet.Fields("Name").Value is equal to strClientName.

3. Map printers based on the computer's OU.
0
 
LVL 1

Author Comment

by:nstd-sts
Comment Utility
thanks shift-3
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

16 Experts available now in Live!

Get 1:1 Help Now