In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzPolicyAssignment PowerShell cmdlet and along with that, we will also discuss the use of the Get-AzPolicyAssignment PowerShell command with an example.
Get-AzPolicyAssignment is a very good Azure PowerShell command to retrieve the policy assignments.
Below is the syntax of the Get-AzPolicyAssignment PowerShell command.
Now, let’s discuss a few examples of how to use the Get-AzPolicyAssignment PowerShell command with a few examples.
Below PowerShell command can help you to retrieve the lists of policy assignments.
After running the above command, I got the below output.
PS C:\WINDOWS\system32> Get-AzPolicyAssignment
Name : SecurityCenterBuiltIn
ResourceId : /subscriptions/1cdf4300-dee5-4518-8c8c-feaa72a5ghd1/providers/Mic
ResourceName : SecurityCenterBuiltIn
ResourceType : Microsoft.Authorization/policyAssignments
SubscriptionId : 1cdf4300-dee5-4518-8c8c-feaa72a5ghd1
PolicyAssignmentId : /subscriptions/1cdf4300-dee5-4518-8c8c-feaa72a5ghd1/providers/Mic
Properties : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.P
You can see the same output here as below
Get-AzPolicyAssignment – Video Tutorial
Check out a video tutorial on this command.
In this Azure article, we discussed, the syntax and usage of the Get-AzPolicyAssignment PowerShell cmdlet and along with certain examples of how to use this command.
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, 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.