Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

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

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
funasset
Asked:
funasset
  • 7
  • 6
1 Solution
 
DansDadUKCommented:
>> ... 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
 
funassetAuthor Commented:
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
 
Neil RussellTechnical Development LeadCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
funassetAuthor Commented:
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
 
Neil RussellTechnical Development LeadCommented:
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
 
Neil RussellTechnical Development LeadCommented:
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
 
funassetAuthor Commented:
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
 
funassetAuthor Commented:
Sorry - our updates crossed in the ether. I'll change that variable and see what happens......
0
 
Neil RussellTechnical Development LeadCommented:
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
 
funassetAuthor Commented:
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
 
Neil RussellTechnical Development LeadCommented:
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
 
funassetAuthor Commented:
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
 
funassetAuthor Commented:
Just what I needed to do. Sorted.
0
 
Neil RussellTechnical Development LeadCommented:
Your welcome. Glad to have helped
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now