Solved

On a File/Print server, is there a way to tell who has certain printers mapped?

Posted on 2010-08-25
3
322 Views
Last Modified: 2012-06-27
We are getting ready to do a major printer shuffle.  At that time printer names will be changed to fit the new locations of the printers.

Being slightly 'proactive' we would like to inform the individuals that have the effected printers currently mapped to their PCs so they can delete the currently mapped printer and reconnect the appropriate one after the shuffle.

We have been unable to locate anywhere, "How to tell who has which printer mapped" within out domain.
0
Comment
Question by:wrogge
3 Comments
 
LVL 8

Assisted Solution

by:russell124
russell124 earned 150 total points
ID: 33524657
Here is a good article on how to do so via VBS:

http://blogs.technet.com/b/heyscriptingguy/archive/2006/08/14/how-can-i-list-all-the-printers-on-a-remote-computer.aspx

You are likely going to need to run this under the context of the logged in user, I don't know your particular environment, so I am not sure as to the best way to do this.  You may be able to add this to the user's logon script and modify the above vbs to append a shared log file (with workstation/username/printer) at logon.
0
 
LVL 9

Accepted Solution

by:
asawatzki earned 350 total points
ID: 33524853
I'm not sure this is possible from the server end.  There is a way to tell who at any given moment is printing to the printers (example: http://blogs.technet.com/b/heyscriptingguy/archive/2006/01/19/how-can-i-tell-which-users-are-connected-to-a-print-queue.aspx).  But I don't know of any way from the server side to tell who is mapped to what printer.  Perhaps if you turned on some special auditing settings for print queues.

In my experience the easiest way to do this would be through a log on script run on their local machine.  If you want to get fancy you can use the script to remap them and turn it on after you do the printer move and just have it report back the results of the remapping.  

Below is a sample script that would just report to you what each user has mapped.  It will create a text file in a file share each time a user logs into a machine, just change the PrintServer and OutputLocation variables in the beginning your print server and a share that users have write access to.
PrintServer = "\\PrintServer"
OutputLocation = "\\FileServer\WriteableShare"


Set WshNetwork = CreateObject("WScript.Network")
strUsername = WshNetwork.username
strComputer = WshNetwork.computerName
OutputFile= OutputLocation & "\" & strUsername & "-" & strComputer & ".txt"

Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set oLogFile = objFSO.CreateTextFile(OutputFile, True)

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer where Network=True",,48)
For Each objItem In colItems
  bChange = False
  If ucase(objItem.ServerName) = ucase(PrintServer) Then
    strPrinterPath = Ucase(objItem.ServerName & "\" & objItem.ShareName)
    oLogFile.WriteLine strPrinterPath
  End If
Next

oLogFile.Close
Set objWMIService = Nothing
Set oLogFile = Nothing
set objFSO = Nothing
set wshNetwork = nothing

Open in new window

0
 

Author Comment

by:wrogge
ID: 33524955
The script is 'ok', but it displays a POP UP for every printer rather than the ability to record it somewhere.
Without being able to record it somewhere, we are still in the same boat.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Resolve DNS query failed errors for Exchange
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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