powershell - Getting The print servers in a network -
i want write powershell script print servers in network.
i have used next ldap query, returns servers network printers attached it. not other print servers have remote printer attached it. here's code used print servers (but getting servers n/w printers)
import-module activedirectory [array]$testarray = get-adobject -ldapfilter "(&(&(&(uncname=*)(objectcategory=printqueue))))" -properties *|sort-object -unique -property servername |select servername $testarray
you seek get-wmiobject win32_printer | select name,local wrapped in foreach-object loop this:
$servers | foreach-object { get-wmiobject win32_printer -computername $_ | where-object {$_.local -like 'false'} | select name,local,systemname | format-table -a } the $servers can scoped whatever servers need check.
use get-wmiobject win32_printer | select * see properties want study on , include them in | select name,local,systemname section of script
powershell networking printing
No comments:
Post a Comment