GetPrinterDetails

      No Comments on GetPrinterDetails

Function GetVersion{

Param ([string]$PrintServer = “localhost”)
$Results = @()

ForEach ($Driver in (Get-WmiObject Win32_PrinterDriver -ComputerName $PrintServer))
{ $Drive = $Driver.DriverPath.Substring(0,1)
$Results += New-Object PSObject -Property @{
Name = $Driver.Name
Server = $Driver.PSComputername
}
Write-Host $Results
}
$Results

}
cls

Add-PSSnapin Citrix* -ErrorAction SilentlyContinue

$GetXAZone = Get-XAZone
$XAZoneName = $GetXAZone.ZoneName
$XAServerList = Get-XAServer -ZoneName $XAZoneName -OnlineOnly
$CompleteList = Foreach ($item in $XAServerList.servername){GetVersion $item
#add-content -path GetPrinterDetails_log.txt -value “Citrix Server: $item”
}
$SortedList = $CompleteList | Sort-Object -Property name -Unique

Foreach ($item in $SortedList.name){write-host $Item}
$SortedListCount = $SortedList.Count
$XAServerListCount = $XAServerList.Count
# add-content -path GetPrinterDetails_log.txt -value “$SortedListCount unique drivers on $XAServerListCount Citrix servers”

# GetVersion SDCACTXDSKD2 | Sort-Object -Property name -Unique

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.