mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
@@ -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
|
||||||
```
|
```
|
||||||
|
|||||||
+1
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user