Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for showprn.ps

(view source code of showprn.ps as plain text)

  1. # WMI query to list all properties and values of the Win32_Printer class
  2. # This PowerShell script was generated using the WMI Code Generator, Version 1.30
  3. # http://www.robvanderwoude.com/updates/wmigen.html
  4.  
  5. param( [string]$strComputer = "." )
  6.  
  7. $colItems = get-wmiobject -class "Win32_Printer" -namespace "root\CIMV2" -computername $strComputer
  8.  
  9. foreach ($objItem in $colItems) {
  10. 	write-host "Name                           :" $objItem.Name
  11. 	write-host "Default                        :" $objItem.Default
  12. 	write-host "Network                        :" $objItem.Network
  13. 	write-host "Port Name                      :" $objItem.PortName
  14. 	write-host "Driver Name                    :" $objItem.DriverName
  15. 	write-host "Server Name                    :" $objItem.ServerName
  16. 	write-host "Share Name                     :" $objItem.ShareName
  17. 	write-host
  18. }
  19.  

page last modified: 2024-04-16; loaded in 0.0069 seconds