Created
June 11, 2021 04:55
-
-
Save macbeth76/3fe0d208a6b12513b6e6255637f30431 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $printers = Get-Printer | |
| $xl = New-Object -ComObject Excel.Application | |
| foreach ($printer in $printers) { | |
| (New-Object -ComObject WScript.Network).SetDefaultPrinter($printer.name) | |
| $xl = New-Object -ComObject Excel.Application | |
| $xl.Visible = $false | |
| $xl.ActivePrinter | |
| } | |
| $xl.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment