Solved

Terminal server printer mapping.

Posted on 2006-10-24
6
539 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 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