UCS port license report.

This is simple, but handy.  It’s just some formatting around the PowerTool cmdlet Get-UcsLicense.  Then I either export it to a CSV or leave it on the screen, and I might wrap it in a loop to report on all our UCS FEs.

Below are two snippets.  First, connecting to one UCS and exporting to a CSV file.  And then connecting to several UCSs, filtering on UCSs that are short licenses, and printing to the screen.

Get-UcsLicense | Select-Object Ucs,Scope,Feature,Sku,AbsQuant,DefQuant,UsedQuant,@{n="RemQuant";e={$_.AbsQuant-$_.UsedQuant}},Status,PeerStatus,OperState,GracePeriodUsed | Export-Csv-Path "UCSLicenseReport_$($DefaultUcs | Select-Object -Expand Ucs)_$(Get-Now).csv" -NoTypeInformation


gc UCSs.txt | % {
   Connect-Ucs-Name$_-Credential$ucscred | select ucs,VirtualIpv4Address,username,version | ft-a
   Get-UcsLicense | Select-Object Ucs,Scope,Feature,Sku,AbsQuant,DefQuant,UsedQuant,@{n="RemQuant";e={$_.AbsQuant-$_.UsedQuant}},Status,PeerStatus,OperState,GracePeriodUsed | ? { $_.RemQuant -lt0 } | ft-a
   Disconnect-Ucs
}

Hope this helps

Chris

Advertisements