?
Solved

Terminal server printer mapping.

Posted on 2006-10-24
6
Medium Priority
?
540 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Shift-3
ID: 17796494
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
ID: 17796567
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
ID: 17799489
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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
LVL 1

Author Comment

by:nstd-sts
ID: 17799732
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 1500 total points
ID: 17800457
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
ID: 17844216
thanks shift-3
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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