--- external help file: PSAD-help.xml online version: https://github.com/zloeber/PSAD schema: 2.0.0


Add-DSGroupMember

SYNOPSIS

Adds AD objects to a specified group.

SYNTAX

Add-DSGroupMember [-Group <String>] [-Force] [-Identity <String>] [-ComputerName <String>]
 [-Credential <PSCredential>] [-Limit <Int32>] [-SearchRoot <String>] [-Filter <String[]>]
 [-BaseFilter <String>] [-Properties <String[]>] [-PageSize <Int32>] [-SearchScope <String>]
 [-SecurityMask <String[]>] [-TombStone] [-ChangeLogicOrder] [-ModifiedAfter <DateTime>]
 [-ModifiedBefore <DateTime>] [-CreatedAfter <DateTime>] [-CreatedBefore <DateTime>] [-DontJoinAttributeValues]
 [-IncludeAllProperties] [-IncludeNullProperties] [-ExpandUAC] [-Raw] [-ResultsAs <String>] [-LiteralFilter]

DESCRIPTION

Adds AD objects to a specified group.

EXAMPLES

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

get-dsuser jdoe | Add-DSGroupMember -Group 'Sales Team' -force

Adds jdoe to the 'Sales Team' group without prompting for confirmation.

PARAMETERS

-Group

Group name to add accounts as a member of.

Type: String
Parameter Sets: (All)
Aliases: GroupName

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Force add to group membership without confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-BaseFilter

Immutable base ldap filter to use.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ChangeLogicOrder

Use logical OR instead of AND for custom LDAP filters.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ComputerName

Domain controller to use for this search.

Type: String
Parameter Sets: (All)
Aliases: Server, ServerName

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CreatedAfter

Only include objects created after this date.

Type: DateTime
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CreatedBefore

Only include objects created before this date.

Type: DateTime
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Credential

Credentials to connect with.

Type: PSCredential
Parameter Sets: (All)
Aliases: Creds

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DontJoinAttributeValues

Do not joine attribute values in output.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExpandUAC

Expand useraccountcontroll property (if it exists).

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Filter

LDAP filters to use.

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Identity

Object to retreive.

Type: String
Parameter Sets: (All)
Aliases: sAMAccountName, distinguishedName

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-IncludeAllProperties

Include all properties that have a value

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IncludeNullProperties

Include null property values

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Limit

Limit results. If zero there is no limit.

Type: Int32
Parameter Sets: (All)
Aliases: SizeLimit

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-LiteralFilter

Escapes special characters in the filter ()/*`0

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModifiedAfter

Only include objects modified after this date.

Type: DateTime
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModifiedBefore

Only include objects modified before this date.

Type: DateTime
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PageSize

Page size for larger results.

Type: Int32
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Properties

LDAP properties to return

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Raw

Do no property transformations in output.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ResultsAs

How you want the results to be returned.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SearchRoot

Root path to search.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SearchScope

Type of search.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SecurityMask

Security mask for search.

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TombStone

Include tombstone objects.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

INPUTS

OUTPUTS

NOTES

It is best to pipe users in via get-dsuser or get-dscomputer where possible. This function is missing -Whatif implementation at this time.

https://github.com/zloeber/PSAD