Share via


Add-DPMSecurityGroup

Add-DPMSecurityGroup

Adds security groups to a DPM role.

Syntax

Parameter Set: Default
Add-DPMSecurityGroup [-DpmRole] <DpmRole> [-SecurityGroups] <String[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Add-DPMSecurityGroup cmdlet adds one or more security groups to a System Center 2012 – Data Protection Manager (DPM) role. You can use the Get-DPMRole to specify a DPM role. Use the Set-DPMRole cmdlet to save your changes.

You can see the security groups for a DPM role by using the Get-DPMSecurityGroup cmdlet. You can use the Remove-DPMSecurityGroup cmdlet to remove security groups from a DPM role.

Parameters

-DpmRole<DpmRole>

Specifies a DPM role to which this cmdlet adds a security group. To obtain a DPM role object, use the Get-DPMRole cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SecurityGroups<String[]>

Specifies an array of security groups. The cmdlet adds these groups to the DPM role.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Add a security group to a role

The first command uses the Get-DPMRole cmdlet to get the role named OpsMgrSQL and then stores it in the $DpmRole variable. The command makes the role editable.

The second command adds the specified security group to the role stored in the $DpmRole variable.

PS C:\> $DpmRole = Get-DPMRole -Name "OpsMgrSQL" -Editable
PS C:\> Add-DPMSecurityGroup -DpmRole $DpmRole -SecurityGroups "Hq\OpsMgrSQL"

Get-DPMSecurityGroup

Remove-DPMSecurityGroup

Get-DPMRole

Set-DPMRole