PowerShell Logo Small

Set-ADGroup



This is the built-in help made by Microsoft for the command 'Set-ADGroup', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 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 {Negotiate | Basic}] [-Clear <String[]>] [-Credential <PSCredential>] [-Description <String>] [-DisplayName
<String>] [-GroupCategory {Distribution | Security}] [-GroupScope {DomainLocal | Global | Universal}] [-HomePage <String>] [-ManagedBy <ADPrincipal>] [-Partition <String>]
[-PassThru] [-Remove <Hashtable>] [-Replace <Hashtable>] [-SamAccountName <String>] [-Server <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-ADGroup [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-PassThru] [-Server <String>] -Instance <ADGroup> [-Confirm] [-WhatIf] [<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 cmdlet. 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, type Get-Help about_ActiveDirectory_Instance.



<

RELATED LINKS

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

REMARKS

<

Examples


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

PS C:\>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



This command sets the description property of the group AccessControl to Access Group on an ADAM instance.




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

PS C:\>Get-ADGroup -Filter 'name -like "Access*"' | Set-ADGroup -Description "Access Group"



This command modifies the description on all groups that have a name that starts with access by using the pipeline operator.




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

PS C:\>$group = Get-ADGroup -Server localhost:60000 -Identity "CN=AccessControl,DC=AppNC"
PS C:\> $group.description = "Access Group"
PS C:\> 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



This example sets the description property on the AccessControl group by using the Instance parameter.