Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Terminal server printer mapping.

Posted on 2006-10-24
6
Medium Priority
?
541 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

610 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