Solved

Is it possible to automatically create 'dummy' printers in Windows 7/2008/2012?

Posted on 2015-01-22
14
188 Views
Last Modified: 2015-01-22
I need to do some load/capacity testing on Windows 7/2008 and 2012. It involves having to mimic a situation where there are maybe 100+ printers installed on the machine.  All I'm interested in is having the printers 'there' and sending output to a port where it will be picked up by some other software and effectively put in a big black hole.

Creating 100+ dummy printers manually would take ages so I wondered if anyone knew of a way to automate this process and (if possible) specify a sequence for the printer names i.e. P1, P2, P3....P100?

Many thanks
0
Comment
Question by:funasset
  • 7
  • 6
14 Comments
 
LVL 16

Expert Comment

by:DansDadUK
ID: 40564055
>> ... having the printers 'there' and sending output to a port where it will be picked up by some other software and effectively put in a big black hole. ...

Don't know how to automate (PowerShell script perhaps?), but as regards the output, you could maybe set up the printers to print to  the FILE: port, so you'd get (multiple) 'big files' instead of a 'big black hole'.
0
 

Author Comment

by:funasset
ID: 40564078
Thanks for the tip. Appreciate it.

It's the automatic creation that is giving me the headache. I'm sure that someone out there knows.......I'm not a Developer or scripting-type person so I will need a bit of a noddy guide! If it CAN be done that is!
0
 
LVL 37

Accepted Solution

by:
Neil Russell earned 500 total points
ID: 40564097
Follow this page and you will have it done in no time :P

http://blog.powershell.no/2009/11/07/bulk-create-printer-objects-on-print-servers-using-windows-powershell/

Allows you to create a CSV file with printers and drivers, IP etc all listed.
Have a read and try.  Its fairly self explanatory.
0
 

Author Comment

by:funasset
ID: 40564164
Many thanks - that looks (even to a lowly tester like me!) like it is along the lines of what I need to do.

A couple of questions about the scripting process and csv requirements.......

1. I don't think it's possible in Excel to create a mixed series? So if I wanted Dummy-1, Dummy-2 then I don't think Excel will let me create a series like that to get to Dummy-100. Does that mean my printer names will have to be simply numeric i.e. 1,2,3,4....100?

2. Is it possible to tweak/add something in the script to ignore/do away with Sharename, Location and Comment as I don't need those items?

3. How can I make sure that all instances are set to print using LPR in their port settings?

Many thanks
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40564250
1) My excel does.  Enter dummy-1 in A1 and then copy down....
2) Just use printername in all 3 columns of the CSV for Sharename, Location and Comment  as editing the script is not something I can do right now, or can you wait till later?
3)  I will think....
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40564260
For 3)  Change the line in the script that reads...
$port.Protocol=1

Open in new window


To read...

$port.Protocol=2

Open in new window

0
 

Author Comment

by:funasset
ID: 40564266
Cheers for that.  I had a tentative crack at creating just one new printer and it actually worked - albeit it's simply called '1' and the port isn't configured as I need it but I felt quite chuffed - it doesn't take much at my age.

1. I'll have a tinker with Excel. Thanks.
2. I changed the $print.Shared=$true to $false and left the columns in the CSV blank. A stab in the dark but it seemed to work.
3. I need them to be set to LPR and given the Queue name 'Test'.  I see that in the discussion some people add new lines to the script so I guess there is a list of things associate with '$print' somewhere.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:funasset
ID: 40564268
Sorry - our updates crossed in the ether. I'll change that variable and see what happens......
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40564277
if you run the following in a powershell window...

clear

$server = “.”
$print = ([WMICLASS]”\\$($server)\ROOT\cimv2:Win32_Printer”).createInstance()
$print | Get-Member

Open in new window


You will get listed ALL of the properties and methods of that print object.
0
 

Author Comment

by:funasset
ID: 40564373
I think I may actually be there bar the incrementing of the printer names. Magic!

Are we talking about the same thing as far as the Excel series? I was hoping to create the first entry and have the names incremented by using the Fill--Series feature so that I'd get a column of 100 names beginning

Dummy-1
Dummy-2
Dummy-3 .......etc

If I create Dummy-1 and just copy down I simply get lines all with Dummy-1 as the name. It's no biggie to have the printers simply listed in Windows as 1, 2, 3.... I could live with that if needs be.

Your help is much appreciated.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40564501
What version of excel? As i say I just put dummy-1 in A! and then grabbed the corner and dragged down and it filled with increment in 2010
0
 

Author Comment

by:funasset
ID: 40564555
Excellent!! I was grabbing the cell in the wrong place. That's 2 new things I've learned today - and will no doubt forget by tomorrow :)

Thanks for all your help.

Cheers
0
 

Author Closing Comment

by:funasset
ID: 40564556
Just what I needed to do. Sorted.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40564856
Your welcome. Glad to have helped
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Survey software 5 48
merge adobe pdf files 14 91
Simple (?) problem getting Rainbow Folders to run 6 80
PDF to Word 25 103
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

707 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