Merge pull request #1189 from anosov1960/master

Added ESU timestamp
This commit is contained in:
Alexander (Sasha) Nosov
2023-07-11 17:28:46 -07:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
@@ -66,7 +66,7 @@ The following command will scan resource group `<resource_group_name>` in the su
## Example 4 ## Example 4
The following command will set License Type to 'Paid" and enables ESU on all servers in the subscriptions `<sub_id>` and the resource group `<resource_group_name>`. The following command will set License Type to 'Paid" and enables ESU on all servers in the subscriptions `<sub_id>` and the resource group `<resource_group_name>`.
```console ```console
.\modify-license-type.ps1 -SubId <sub_id> -ResourceGroup <resource_group_name> -LicenseType Paid -EnableESU Yes -Force .\modify-license-type.ps1 -SubId <sub_id> -ResourceGroup <resource_group_name> -LicenseType Paid -EnableESU Yes -Force
``` ```
@@ -210,6 +210,7 @@ foreach ($sub in $subscriptions){
if ($EnableESU) { if ($EnableESU) {
if (($settings["LicenseType"] | select-string "Paid","PAYG") -or ($EnableESU -eq "No")) { if (($settings["LicenseType"] | select-string "Paid","PAYG") -or ($EnableESU -eq "No")) {
$settings["enableExtendedSecurityUpdates"] = ($EnableESU -eq "Yes") $settings["enableExtendedSecurityUpdates"] = ($EnableESU -eq "Yes")
$settings["esuLastUpdatedTimestamp"] = [DateTime]::UtcNow.ToString('yyyy-MM-ddTHH:mm:ss.fffZ')
$WriteSettings = $true $WriteSettings = $true
} else { } else {
write-host "The configured license type does not support ESUs" write-host "The configured license type does not support ESUs"