Solved

Script with Net Use LPT1 command to go to a machine specific path through GPO distribution - any ideas?

Posted on 2006-11-28
5
1,101 Views
Last Modified: 2010-05-18
Here's another one guys, I hope someone can help :)

I'm completely familiar with the NET USE command for setting up mapped folders and redirected LPT ports.

I have a more specific request though. Could anyone tell me if there is any syntax I can use within a line that redirects the LPT port to a location based on the specific users machine name? As an example, I want the machine 'JOHN-SMITH' to do the following:

NET USE LPT1 \\JOHN-SMITH\HPPRINTER\

But I don't want to have to do it for each user manually in this way. I want to roll out a GPO that will do something to the effect of:

NET USE LPT1 \\USERSMACHINE\HPPRINTER\

So that when the system logs in and gets the script from the GPO, it automatically maps the LPT port having read the user machine name. I hope this makes sense. Perhaps some kind person could advise?

Many thanks,

Bluemercury
0
Comment
Question by:bluemercury
[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
5 Comments
 
LVL 14

Accepted Solution

by:
canali earned 500 total points
ID: 18032521
@echo off
::mapLPT.cmd
::
net use LPT1 \\%COMPUTERNAME%\HPPRINTER
:: bye Gastone
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18059628
Thanks you so much for posting this - couldn't find it anywhere on the web! I ended up using the net use command on each computer locally in the end as i was desperate to get things working. In the next few weeks there are going to be some new machines joining the network though, and as they do I'll try using your suggestion via a GPO. I'll come back to let you know if it works, and award points once I've had a chance to impement it.

Thanks so much for your help.

Best wishes,

Bluemercury
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18389784
I'd like to still try out the user's solution - I suspect it will work, and if so he deserves the credit for having advised it. I have yet to be able to test it in our working environment. I'm due to reimplement the whole network at my work place in the next 3 weeks though, so could you leave it open that long? I promise to come back and respond within 21 days :)

Bluemercury
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18670330
Ok, it took a little longer than 3 weeks (lots of Server problems at work) but I've finally been able to try out your Net Use suggestion. It worked fantastically, and speed up the process of distrbuting DOS printer maps using a GPO no end! Thanks so much for your help - class A advice, and I will award the points immediately.

Many thanks,

Bluemercury
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

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.…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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