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
|`-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|
31
-
|`-ResourceGroup`|resource_group_name|*Optional*: Limits the scope to a specific resource group|
32
-
|`-MachineName`|machine_name|*Optional*: Limits the scope to a specific machine|
33
-
|`-LicenseType`|"Paid", "PAYG" or "LicenseOnly"|*Optional*: Sets the license type to the specified value |
34
-
|`-ConsentToRecurringPAYG`|"Yes" or "No"|*Optional*. Consents to enabling the recurring PAYG billing. LicenseType must be "PAYG". Applies to CSP subscriptions only.|
35
-
|`-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"|
36
-
|`-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"|
37
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 PowerShell and CLI using managed identity. Required to run the script as a runbook.|
38
55
39
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
+
```
67
+
68
+
# Script execution examples
43
69
44
70
## Example 1
45
71
46
-
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.
72
+
The following command will scan all the subscriptions in tenant `<tenant_id>`, and list the machines that would have the license type change to "PAYG" on all servers where license type is undefined.
The following command will scan the subscription `<sub_id>` and set the license type value to "Paid" on all servers.
80
+
The following command will scan the subscription `<sub_id>`in the current tenant and set the license type value to "Paid" on all servers listed in `machines.csv`.
The following command will scan resource group `<resource_group_name>` in the subscription `<sub_id>`, set the license type value to "PAYG" and enable unlimited virtualization license on all servers in the specified resource group.
88
+
The following command will scan resource group `<resource_group_name>` in the subscription `<sub_id>` within the current tenant, set the license type value to "PAYG" and enable unlimited virtualization license on all servers in the specified resource group.
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>`.
96
+
The following command will set License Type to "Paid" and enables ESU on all servers in the subscriptions `<sub_id>`of tenant `<tenant_id>`and the resource group `<resource_group_name>` except those with the tag `Environment:Dev`
The following command will disable ESU on all servers in the subscriptions `<sub_id>`.
79
105
80
106
```console
81
-
.\modify-license-type.ps1 -SubId <sub_id> -EnableESU No
107
+
.\modify-arc-sql-license-type.ps1 -SubId <sub_id> -EnableESU No
82
108
```
83
109
84
110
## Example 6
85
111
86
-
The following command will scan all subscriptions in the account, set the license type value to "PAYG" and consents to enabling recurring billing on all servers in the account.
112
+
The following command will scan all subscriptions in the account using managed identity, set the license type value to "PAYG" and consents to enabling recurring billing on all servers in the account.
1. Make sure the the Az module is installed. For more information, see [Install the Azure Az PowerShell module](https://learn.microsoft.com/powershell/azure/install-az-ps):
137
-
138
-
```console
139
-
Install-Module Az -Scope CurrentUser -Repository PSGallery -Force
0 commit comments