New-AzPolicyAssignment

Active Directory Auditing Tool

The Who, Where and When information is very important for an administrator to have complete knowledge of all activities that occur on their Active Directory. This helps them identify any desired / undesired activity happening. ADAudit Plus assists an administrator with this information in the form of reports. In real-time, ensure critical resources in the network like the Domain Controllers are audited, monitored and reported with the entire information on AD objects - Users, Groups, GPO, Computer, OU, DNS, AD Schema and Configuration changes with 200+ detailed event specific GUI reports and email alerts.

Object Access » New-AzPolicyAssignment

How to create a new Azure Policy Assignment using Azure PowerShell.

Description:

An assignment can be defined as a policy that has been assigned to take place within a specific scope. The New-AzPolicyAssignment cmdlet creates a new policy assignment.

Syntax:

New-AzPolicyAssignment -Name <String> [-Scope <String>] [-NotScope <String[]>] [-DisplayName <String>] [-Description <String>] [-PolicyDefinition <PsPolicyDefinition>] [-PolicySetDefinition <PsPolicySetDefinition>] [-Metadata <String>] [-EnforcementMode <PolicyAssignmentEnforcementMode>] [-AssignIdentity] [-Location <String>] [-ApiVersion <String>] [-Pre] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]

Example: The below mentioned PowerShell creates a Policy Assignment at subscription level.

Line 1: PS C:\> $Subscription = Get-AzSubscription -SubscriptionName 'Subscription10' Line 2: PS C:\> $Policy = Get-AzPolicyDefinition -Name 'VirtualMachinePolicy' Line 3: PS C:\> New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicyDefinition $Policy -Scope "/subscriptions/$($Subscription.Id)"

Line 1 is the Get-AzSubscription command that gets a subscription under the name "Subscription 10" and stores it in the $Subscription variable.

Line 2 is the Get-AzPolicyDefinition command that gets the policy definition with the name Virtual Machine and stores it in the $Policy variable.

Line 3 uses the New-AzPolicyAssignment to assign the policy in $Policy at the level of the subscription identified by the subscription scope string.

About ADAudit Plus

ADAudit Plus is a real time change auditing software that helps keep your Active Directory, Azure AD, Windows file servers, NetApp filers, EMC file systems, Synology file systems, Windows member servers, and workstations secure. With ADAudit Plus, you can get visibility into:

  • Authorized and unauthorized AD management changes
  • User logons, logoffs, and account lockouts
  • GPO changes
  • Group attribute and membership changes
  • OU changes
  • Privileged access and permission changes among other things.

There are more than 200 event-specific reports, and you can configure instant email alerts. You can also export the reports to XLS, HTML, PDF and CSV formats to assist in interpretation and forensics. For more information on ADAudit Plus, visit: https://www.manageengine.com/active-directory-audit/.