Get-UnityLicense by rfoust 3 years ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/750"></script>download | new post
This function connects via HTTP to a Cisco Unity server and returns license information as a PSCustomObject.
- #
- # get-unitylicense.ps1
- #
- # Returns license information for a Cisco Unity environment
- # Usage: get-unitylicense <server>
- #
- # Author: Robbie Foust (rfoust@duke.edu)
- #
- function global:get-unitylicense ([string]$server = $(throw "Please provide a server name!"))
- {
- $webContent = new-object net.webclient
- $page = $webContent.DownloadString("http://$server/avxml/effectivelicense.asp")
- # remove leading whitespace
- $page = $page -replace "^.`n"
- $license = [xml]$page
- new-object psobject | add-member -memberType NoteProperty -name LicLanguagesMax -value $license.AvXmlLicData.Licenses.LicLanguagesMax -passthru |
- add-member -memberType NoteProperty -name LicMaxMsgRecLenIsLicensed -value $license.AvXmlLicData.Licenses.LicMaxMsgRecLenIsLicensed -passthru |
- add-member -memberType NoteProperty -name LicPoolingIsEnabled -value $license.AvXmlLicData.Licenses.LicPoolingIsEnabled -passthru |
- add-member -memberType NoteProperty -name LicSubscribersMax -value $license.AvXmlLicData.Licenses.LicSubscribersMax -passthru |
- add-member -memberType NoteProperty -name LicUMSubscribersMax -value $license.AvXmlLicData.Licenses.LicUMSubscribersMax -passthru |
- add-member -memberType NoteProperty -name LicVMISubscribersMax -value $license.AvXmlLicData.Licenses.LicVMISubscribersMax -passthru |
- add-member -memberType NoteProperty -name LicVoicePortsMax -value $license.AvXmlLicData.Licenses.LicVoicePortsMax -passthru |
- add-member -memberType NoteProperty -name AvLicUtilizationSecondaryServer -value $license.AvXmlLicData.Utilization.AvLicUtilizationSecondaryServer -passthru |
- add-member -memberType NoteProperty -name AvLicUtilizationSubscribers -value $license.AvXmlLicData.Utilization.AvLicUtilizationSubscribers -passthru |
- add-member -memberType NoteProperty -name AvLicUtilizationVMISubscribers -value $license.AvXmlLicData.Utilization.AvLicUtilizationVMISubscribers -passthru
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository