Create a new group in active directory.
Syntax
New-QADGroup [-Name] String
-ParentContainer IdentityParameter
[-GroupType GroupType] [-GroupScope GroupScope]
ADProperties Advanced_Options
[-DeserializeValues] [-WhatIf] [-Confirm]
Key
-ParentContainer The Distinguished Name (DN) of the container in which to
create the new directory object.
-GroupType 'Security' or 'Distribution'
-GroupScope 'Global' 'Universal' or 'DomainLocal'
ADProperties Set one or more of the properties below:
[-Description String] [-DisplayName String]
[-SamAccountName String] [-Member IdentityParameter[]]
-DeserializeValues
Use if the input contains serialized attribute values
(for instance, when importing a directory object from a text
file that was created using -Serialize)
-WhatIf Describe what would happen if you executed the command,
without actually executing the command.
-Confirm Prompt for confirmation before executing the command.
Advanced_Options:
[-ObjectAttributes ObjectAttributesParameter]
[-UseDefaultExcludedProperties]
[-UseDefaultExcludedPropertiesExcept String []] [-ExcludedProperties String[]]
[-IncludedProperties String[]] [-UseGlobalCatalog]
[-Proxy] [-Service String]
[-ConnectionAccount String] [-ConnectionPassword SecureString]
[-Credential PSCredential] [-Connection ArsConnection]
Notes:
By default New-QADGroup will connect to any available domain controller with the credentials of the locally logged on user, to connect to a specific domain controller using a specific account, either use the advanced options (-Proxy/-Service/-ConnectionAccount) or use the Connect-QADService cmdlet to make the connection.
Examples
Create a new universal distribution group:
PS C:> new-qadGroup -name 'grp_demo' -ParentContainer 'OU=demo,DC=ss64,DC=com'
-samAccountName 'grp_demo' -grouptype 'Distribution' -groupscope 'Universal'
Create a new local domain group with the name matching the value in the 'NEWTEAMS' column in the CSV file
PS C:> import-csv C:\accounts.csv | %{new-qadGroup -name $_.'NEWTEAMS' -ParentContainer
'OU=demo,DC=ss64,DC=com' -GroupScope 'DomainLocal' -samAccountName $_.'NEWTEAMS'}
“Finding good players is easy. Getting them to play as a team is another story” - Casey Stengel (American Baseball Player)
Related Powershell Commands:
Set-QADGroup - Modify attributes of group(s)
Get-QADGroup - Retrieve groups that match specific conditions
Quest cmdlets