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.
Table of Contents
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.

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.

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 !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
