Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Power Shell Script

$
0
0

I have a script I am writing to help deploy printers on our network. The user will be able to pick from a selection of 4 printers and that will be the default printer.

Here is the code

Powershell
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")# Array of "printer objects"$Printer=@(New-Objectpsobject-Property@{Name="HP Color LaserJet CP2020"SetCommand={((New-Object-ComObjectWScript.Network).SetDefaultPrinter('\\WW637DPRINT03\Belfast-09-HPCLJ'))}},New-Objectpsobject-Property@{Name="Brother DCP-8065DN"SetCommand={((New-Object-ComObjectWScript.Network).SetDefaultPrinter('\\WW637DPRINT03\Belfast-05-BroMFP'))}},New-Objectpsobject-Property@{Name="Canon iR-ADV C2220/2230"SetCommand={((New-Object...

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>