Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2015-01-22
14
Medium Priority
?
211 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
[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
  • 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 2000 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

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
 

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

I originally wrote this article to compare SARDU and YUMI, but have now added Easy2Boot, since that is the one I currently use and find the easiest to create and alter.
Article by: Shawn
IT teams define success as solving problems quickly. To enable ITSM modernization we have to think of adopting the tools and methods that will enable resolution of ITSM issues more quickly.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

661 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