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

x
?
Solved

Mapping a pritner for a user...

Posted on 2004-10-25
3
Medium Priority
?
198 Views
Last Modified: 2010-04-14
...how would i map a printer for a remote user to a lpt3 port. Windows 2000 enviroment, locally would be net use lpt3: \\server\printer /persistent:yes now how would i do on a remote machine?

MCR
0
Comment
Question by:mrochac
[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
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 12401747
If you have administrative rights on all the computers, then you can use PSEXEC from Sysinternals (http://www.sysinternals.com/ntw2k/freeware/psexec.shtml).  It allows you to execute commands on remote machines.  And if you need to do this on a number of machines, then you could script the execution - running through a loop of machine names issuing the PSEXEC command for each.
0
 
LVL 1

Author Comment

by:mrochac
ID: 12403479
Exacly what i wanted, one more ? do you know how to find out what printers are installed locally?

MCR
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12405371
Yes.  Here's a simple script (VBScript) that uses WMI (Windows Management Instrumentation) to return the details of all the installed printers on the local computer.  If you have adequate rights you can use this script to get the details from a remote computer.  To do that simply change

    strComputer = "."

to
 
    strComputer = "SomeComputerName"

Save the script below into a file ending with .vbs, then run it using CScript.  If you use WScript instead of CScript, then each Wscript.Echo command will create its own dialog-box, which is a real pain.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer",,48)
For Each objItem in colItems
    Wscript.Echo "Attributes: " & objItem.Attributes
    Wscript.Echo "Availability: " & objItem.Availability
    Wscript.Echo "AveragePagesPerMinute: " & objItem.AveragePagesPerMinute
    Wscript.Echo "Capabilities: " & objItem.Capabilities
    Wscript.Echo "CapabilityDescriptions: " & objItem.CapabilityDescriptions
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
    Wscript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
    Wscript.Echo "CreationClassName: " & objItem.CreationClassName
    Wscript.Echo "DefaultPriority: " & objItem.DefaultPriority
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "DetectedErrorState: " & objItem.DetectedErrorState
    Wscript.Echo "DeviceID: " & objItem.DeviceID
    Wscript.Echo "DriverName: " & objItem.DriverName
    Wscript.Echo "ErrorCleared: " & objItem.ErrorCleared
    Wscript.Echo "ErrorDescription: " & objItem.ErrorDescription
    Wscript.Echo "HorizontalResolution: " & objItem.HorizontalResolution
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "JobCountSinceLastReset: " & objItem.JobCountSinceLastReset
    Wscript.Echo "LanguagesSupported: " & objItem.LanguagesSupported
    Wscript.Echo "LastErrorCode: " & objItem.LastErrorCode
    Wscript.Echo "Location: " & objItem.Location
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "PaperSizesSupported: " & objItem.PaperSizesSupported
    Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
    Wscript.Echo "PortName: " & objItem.PortName
    Wscript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
    Wscript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
    Wscript.Echo "PrinterPaperNames: " & objItem.PrinterPaperNames
    Wscript.Echo "PrinterState: " & objItem.PrinterState
    Wscript.Echo "PrinterStatus: " & objItem.PrinterStatus
    Wscript.Echo "PrintJobDataType: " & objItem.PrintJobDataType
    Wscript.Echo "PrintProcessor: " & objItem.PrintProcessor
    Wscript.Echo "SeparatorFile: " & objItem.SeparatorFile
    Wscript.Echo "ServerName: " & objItem.ServerName
    Wscript.Echo "ShareName: " & objItem.ShareName
    Wscript.Echo "SpoolEnabled: " & objItem.SpoolEnabled
    Wscript.Echo "StartTime: " & objItem.StartTime
    Wscript.Echo "Status: " & objItem.Status
    Wscript.Echo "StatusInfo: " & objItem.StatusInfo
    Wscript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
    Wscript.Echo "SystemName: " & objItem.SystemName
    Wscript.Echo "TimeOfLastReset: " & objItem.TimeOfLastReset
    Wscript.Echo "UntilTime: " & objItem.UntilTime
    Wscript.Echo "VerticalResolution: " & objItem.VerticalResolution
    Wscript.Echo ""
Next
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
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…
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…

604 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