Set-AzureADPolicy

In this Azure PowerShell article, we will discuss the syntax and usage of the Set-AzureADPolicy PowerShell command with examples of how to use the Set-AzPolicyDefinition PowerShell command.

Set-AzureADPolicy

This PowerShell command can be used to update a policy in the Azure Active Directory once created.

Syntax

Below is the syntax of the Set-AzureADPolicy PowerShell command.

Set-AzureADPolicy
 -Id <String>

Let’s discuss a few examples of how to use the Set-AzureADPolicy PowerShell command.

Example-1:

You can execute the below PowerShell command to update the display name of the specified policy. I am updating the policy display name from “TsInfoPolicy” to “TsInfoNewPolicy”.

Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228
Set-AzureADPolicy -Id 8a3c7b96-ef63-4419-864d-fb0bc42129e1 -DisplayName 'TsInfoNewPolicy'

After executing the above PowerShell command, I got the below output as expected.

PS C:\WINDOWS\system32> Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228
Set-AzureADPolicy -Id 8a3c7b96-ef63-4419-864d-fb0bc42129e1 -DisplayName 'TsInfoNewPolicy'

Account                   Environment TenantId                             TenantDomai
                                                                           n          
-------                   ----------- --------                             -----------
fewlines4biju@hotmail.com AzureCloud  5d9d690a-0310-474d-ae8b-42df2d549228 fewlines...

You can see the same output in the below screenshot.

Set-AzureADPolicy

To cross-check that the display name of the policy has been changed successfully, I have executed the Get-AzureADPolicy PowerShell command to retrieve the policy details, and I can see the Display name of the policy has been updated successfully. See the screenshot below for reference.

Set-AzureADPolicy PowerShell

Related Article:

Final Thoughts

Well, in this Azure PowerShell article, we discussed the syntax and usage of the Set-AzureADPolicy PowerShell command with examples of how to use this command. Thanks for reading this article !!!