You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/manage/azure-arc-enabled-sql-server/modify-license-type/README.md
+24-11Lines changed: 24 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ ms.date: 05/01/2025
18
18
19
19
05/09/2025 - added *-ReportOnly* and *-TenandId* parameters
20
20
21
+
05/13/2025 - added support for a .CSV file with the machine names
22
+
21
23
# Overview
22
24
23
25
This script provides a scaleable solution to set or change the license type and/or enable or disable the ESU policy on all Azure-connected SQL Servers in a specified scope.
@@ -38,34 +40,45 @@ The script accepts the following command line parameters:
|`-SubId`|subscription_id *or*a file_name|*Optional*: Subscription id or a .csv file with the list of subscriptions<sup>1</sup>. If not specified all subscriptions will be scanned|
42
-
|`-ResourceGroup`|resource_group_name|*Optional*: Limits the scope to a specific resource group|
43
-
|`-MachineName`|machine_name|*Optional*: Limits the scope to a specific machine|
44
-
|`-LicenseType`|"Paid", "PAYG" or "LicenseOnly"|*Optional*: Sets the license type to the specified value |
45
-
|`-ConsentToRecurringPAYG`|"Yes" or "No"|*Optional*. Consents to enabling the recurring PAYG billing. LicenseType must be "PAYG". Applies to CSP subscriptions only.|
46
-
|`-UsePcoreLicense`|"Yes", "No"|*Optional*. Enables unlimited virtualization license if the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
47
-
|`-EnableESU`|"Yes", "No"|*Optional*. Enables the ESU policy the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
43
+
|`-SubId`|`subscription_id`*or*`file_name`|*Optional*: Subscription id or a .csv file with the list of subscriptions<sup>1</sup>. If not specified all subscriptions will be scanned|
44
+
|`-ResourceGroup`|`resource_group_name`|*Optional*: Limits the scope to a specific resource group|
45
+
|`-MachineName`|`machine_name`|*Optional*: A single machine name or a CSV file name containing a list of machine names<sup>2</sup>.|
46
+
|`-LicenseType`|`Paid`, `PAYG` or `LicenseOnly`|*Optional*: Sets the license type to the specified value |
47
+
|`-ConsentToRecurringPAYG`|`Yes`, `No`|*Optional*. Consents to enabling the recurring PAYG billing. LicenseType must be "PAYG". Applies to CSP subscriptions only.|
48
+
|`-UsePcoreLicense`|`Yes`, `No`|*Optional*. Enables unlimited virtualization license if the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
49
+
|`-EnableESU`|`Yes`, `No`|*Optional*. Enables the ESU policy the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
48
50
|`-Force`||*Optional*. Forces the change of the license type to the specified value on all installed extensions. If `-Force` is not specified, the `-LicenseType` value is set only if undefined. Ignored if `-LicenseType` is not specified|
51
+
|`-ExclusionTags`|`{"name":"value","name":"value"}`|*Optional*. If specified, excludes the resources that have this tag assigned.|
52
+
|`-TenantId`|`tenant_id`|*Optional*. If specified, uses this tenant id to log in. Otherwise, the current context is used.|
53
+
|`-ReportOnly`||*Optional*. If true, generates a csv file with the list of resources that are to be modified, but doesn't make the actual change.|
54
+
|`-UseManagedIdentity`||*Optional*. If true, logs in both PoaerShell and CLI using managed identity. Required to run the script as a runbook.|
49
55
50
56
<sup>1</sup>You can create a .csv file using the following command and then edit to remove the subscriptions you don't want to scan.
<sup>2</sup>The .csv file must include a column *MachineName*. E.g.:
61
+
```
62
+
"MachineName",
63
+
"Prod1",
64
+
"Prod2",
65
+
"Prod3"
66
+
```
54
67
55
68
## Example 1
56
69
57
-
The following command will scan all the subscriptions to which the user has access to, and set the license type to "Paid" on all servers where license type is undefined.
70
+
The following command will scan all the subscriptions to which the user has access to, and set the license type to "PAYG" on all servers where license type is undefined, except those with the tag `Environment:Dev`
0 commit comments