PowerShell Logo Small

Set-ADGroup



This is the built-in help made by Microsoft for the command 'Set-ADGroup', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Modifies an Active Directory group.

SYNTAX


Set-ADGroup [-Identity] <ADGroup> [-Add <Hashtable>] [-AuthType <ADAuthType>] [-Clear <String[]>] [-Credential <PSCredential>] [-Description
<String>] [-DisplayName <String>] [-GroupCategory <ADGroupCategory>] [-GroupScope <ADGroupScope>] [-HomePage <String>] [-ManagedBy
<ADPrincipal>] [-Partition <String>] [-PassThru [<SwitchParameter>]] [-Remove <Hashtable>] [-Replace <Hashtable>] [-SamAccountName <String>]
[-Server <String>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]
Set-ADGroup [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-PassThru [<SwitchParameter>]] [-Server <String>] -Instance <ADGroup>
[-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-ADGroup cmdlet modifies the properties of an Active Directory group. You can modify commonly used property values by using the cmdlet
parameters. Property values that are not associated with cmdlet parameters can be modified by using the Add, Replace, Clear and Remove
parameters.


The Identity parameter specifies the Active Directory group to modify. You can identify a group by its distinguished name (DN), GUID, security
identifier (SID) or Security Accounts Manager (SAM) account name. You can also set the Identity parameter to an object variable such as
$<localGroupObject>, or you can pass a group object through the pipeline to the Identity parameter. For example, you can use the Get-ADGroup
cmdlet to retrieve a group object and then pass the object through the pipeline to the Set-ADGroup cmdlet.


The Instance parameter provides a way to update a group object by applying the changes made to a copy of the object. When you set the Instance
parameter to a copy of an Active Directory group object that has been modified, the Set-ADGroup cmdlet makes the same changes to the original
group object. To get a copy of the object to modify, use the Get-ADGroup object. The Identity parameter is not allowed when you use the
Instance parameter. For more information about the Instance parameter, see the Instance parameter description. For more information about how
the Instance concept is used in Active Directory cmdlets, see about_ActiveDirectory_Instance


The following examples show how to modify the Description property of a group object by using three methods:


-By specifying the Identity and the Description parameters


-By passing a group object through the pipeline and specifying the Description parameter


-By specifying the Instance parameter.


Method 1: Modify the Description property for the SecurityLevel2Access group by using the Identity and Description parameters.


Set-ADGroup -Identity SecurityLevel2Access -Description "Used to authorize Security Level 2 access."


Method 2: Modify the Description property for the SecurityLevel2Access group by passing the SecurityLevel2Access group through the pipeline
and specifying the Description parameter.


Get-ADGroup -Identity "SecurityLevel2Access" | Set-ADGroup -Description "Used to authorize Security Level 2 access."


Method 3: Modify the <property> property for the SecurityLevel2Access group by using the Windows PowerShell command line to modify a local
instance of the SecurityLevel2Access group. Then set the Instance parameter to the local instance.


$group = Get-ADGroup -Identity "SecurityLevel2Access"


$group.Description = "Used to authorize Security Level 2 access."


Set-ADGroup -Instance $group.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219347
Add-ADGroupMember
Add-ADPrincipalGroupMembership
Get-ADGroup
Get-ADGroupMember
Get-ADPrincipalGroupMembership
New-ADGroup
Remove-ADGroup
Remove-ADGroupMember
Remove-ADPrincipalGroupMembership

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>set-adgroup -server localhost:60000 -Identity "CN=AccessControl,DC=AppNC" -description "Access Group" -passthru


DistinguishedName : CN=AccessControl,DC=AppNC
GroupCategory : Security
GroupScope : DomainLocal
Name : AccessControl
ObjectClass : group
ObjectGUID : d65f5e8f-36da-4390-9840-8b9fde6282fc
SID : S-1-510474493-936115905-2782881406-1264922549-3814061485-1557022459



Description

-----------

Set the description property of the group AccessControl to "Access Group" on an ADAM instance.




-------------------------- EXAMPLE 2 --------------------------

C:\PS>get-adgroup -filter 'name -like "Access*"' | set-adgroup -description "Access Group"



Description

-----------

Modify the description on all groups that have a name that starts with access via the pipeline.




-------------------------- EXAMPLE 3 --------------------------

C:\PS>PS adam:\DC=AppNC> get-adgroup -filter 'name -like "Access*"' | set-adgroup -description "Access Group"
PS adam:\DC=AppNC> $group = get-adgroup -server localhost:60000 -Identity "CN=AccessControl,DC=AppNC"
PS adam:\DC=AppNC> $group.description = "Access Group"
PS adam:\DC=AppNC> set-adgroup -Instance $group -passthru

DistinguishedName : CN=AccessControl,DC=AppNC
GroupCategory : Security
GroupScope : DomainLocal
Name : AccessControl
ObjectClass : group
ObjectGUID : d65f5e8f-36da-4390-9840-8b9fde6282fc
SID : S-1-510474493-936115905-2782881406-1264922549-3814061485-1557022459



Description

-----------

Set the description property on the AccessControl group via the instance parameter.