Powershell Citrix Lizenzserver - Verbauch der Lizenzen monitoren
Hallo liebe Gemeinde,
ich habe ein Skript auf der Pässler Seite gefunden und versuche es den morgen schon über zu bearbeiten das ich mehrere Lizenzpools damit abfragen kann.
Dies gelingt mir nicht so richtig
innerhalb dieser Abfrage
möchte ich einen weiteren Lizenzpool abfragen und zu dem Ergebnis hinzuzählen.
Wir verwenden MPS_ENT_CCU und XDT_ENT_UD
Wie kann ich dies realisieren?
Gruß
Heiko
Hier das Skript.
http://kb.paessler.com/en/topic/29223-how-can-i-set-up-a-monitor-for-ci ...
ich habe ein Skript auf der Pässler Seite gefunden und versuche es den morgen schon über zu bearbeiten das ich mehrere Lizenzpools damit abfragen kann.
Dies gelingt mir nicht so richtig
innerhalb dieser Abfrage
1
2
3
4
5
2
3
4
5
$LicensePool | ForEach-Object{ If ($_.PLD -eq "MPS_ENT_CCU"){
$Total = $Total + $_.count
$InUse = $InUse + $_.InUseCount
}
}
möchte ich einen weiteren Lizenzpool abfragen und zu dem Ergebnis hinzuzählen.
Wir verwenden MPS_ENT_CCU und XDT_ENT_UD
Wie kann ich dies realisieren?
Gruß
Heiko
Hier das Skript.
http://kb.paessler.com/en/topic/29223-how-can-i-set-up-a-monitor-for-ci ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Setup Variables
$Total = 0
$InUse = 0
$PercentUsed = 0
$Retstring = 0
$RetValue = 0
# Get Citrix licensing Info
# Use the IP address of the License server(-comp switch). I got inconsistent results using the hostname
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp Ip-Adresse
# This will display all the license info....Uncomment for troubleshooting
# $licensePool | Select-Object @{n="Product";e={$_.PLD}},
# @{n="Installed";e={$_.Count}},
# @{n="In Use";e={$_.InUseCount}},
# @{n="Available";e={$_.PooledAvailable}},
# @{n="% in use";e={($_.InUseCount/$_.Count)*100}}
# This loops through all the license info and adds up the total license count and in use count for MPS_ENT_CCU licenses
# If you do not have MPS_ENT_CCU licenses, uncomment the section above and look at the output. Figure out your license count from that. Edit Script as needed
$LicensePool | ForEach-Object{ If ($_.PLD -eq "MPS_ENT_CCU"){
$Total = $Total + $_.count
$InUse = $InUse + $_.InUseCount
}
}
# Uncomment to confirm values are correct
# "Total = ", $Total
# "In Use = ", $Inuse
$PercentUsed = [Math]::Round($inuse/$total*100,0)
# Determine return code. Less than 90%, ok, 90-97 Warning, 98-100 Error
switch ($PercentUsed)
{
{$PercentUsed -lt 90} {
$RetString = [string]$Inuse+":OK"
$RetVal = 0
break
}
{$PercentUsed -ge 90 -and $PercentUsed -lt 98} {
$RetString = [string]$Inuse+":Warning 90-97% License Usage"
$RetVal = 1
break
}
{$PercentUsed -ge 98} {
$RetString = [string]$Inuse+":ALERT 98-100% License Usage"
$RetVal = 2
}
}
# Return Info
Write-Host $RetString
exit $RetVal
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 271450
Url: https://administrator.de/forum/powershell-citrix-lizenzserver-verbauch-der-lizenzen-monitoren-271450.html
Ausgedruckt am: 08.04.2025 um 22:04 Uhr
2 Kommentare
Neuester Kommentar

1
2
3
4
2
3
4
$LicensePool | ?{$_.PLD -eq "MPS_ENT_CCU" -Or $_.PLD -eq "XDT_ENT_UD" } | %{
$Total += $_.count
$InUse += $_.InUseCount
}