Solved

Terminal server printer mapping.

Posted on 2006-10-24
6
537 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
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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