-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathverifySAattestation.kusto
17 lines (17 loc) · 1.05 KB
/
verifySAattestation.kusto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
resources
| where type == 'microsoft.hybridcompute/machines'
| where properties.osType =~ 'windows'
| extend cores = properties.detectedProperties.coreCount
| extend licenseProfile = properties.licenseProfile
| extend licenseStatus = tostring(licenseProfile.licenseStatus)
| extend licenseChannel = tostring(licenseProfile.licenseChannel)
| extend softwareAssurance = licenseProfile.softwareAssurance
| extend productSubscriptionStatus = tostring(licenseProfile.productProfile.subscriptionStatus)
| extend softwareAssuranceCustomer = licenseProfile.softwareAssurance.softwareAssuranceCustomer
| extend benefitsStatus = case(
softwareAssuranceCustomer == true, "Activated",
(licenseStatus =~ "Licensed" and licenseChannel =~ "PGS:TB") or productSubscriptionStatus =~ "Enabled", "Activated via Pay-as-you-go",
isnull(softwareAssurance) or isnull(softwareAssuranceCustomer) or softwareAssuranceCustomer == false, "Not activated",
"Not activated")
| where benefitsStatus == "Activated"
| summarize TotalCores = sum(toint(cores)), ArcConnectedServers = count()