Solved

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

Posted on 2010-08-25
3
321 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Printers have changed substantially in the last 30 or so years, not just in technical capabilities but in cost and usage as well.  Printers were originally used for interfacing with the operator, not necessarily for printing copy or pictures. In …
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now