-
Notifications
You must be signed in to change notification settings - Fork 156
Remove JCUserGroupMember
Removes a JumpCloud User from a JumpCloud User Group
Remove-JCUserGroupMember [-GroupName] <String> [-Username] <String>
[<CommonParameters>]
Remove-JCUserGroupMember [[-GroupName] <String>] [-ByID] [-GroupID <String>] -UserID <String>
[<CommonParameters>]
The Remove-JCUserGroupMember function is used to remove a JumpCloud User from a JumpCloud User Group. The user can be removed by Username or by UserID.
PS C:\> Remove-JCUserGroupMember -Username cclemons -GroupName 'The Band'
Removes the JumpCloud user with Username 'cclemons' from the User Group 'The Band'
PS C:\> Get-JCUser | Where-Object sudo -EQ $false | Remove-JCUserGroupMember -GroupName 'Administrators'
Removes all JumpCloud users where the 'sudo' attribute is equal to $false from the User Group 'Administrators'
PS C:\> Get-JCUser | Where-Object created -lt (Get-Date).AddDays(-7) | Remove-JCUserGroupMember -GroupName 'New Hires'
Removes all JumpCloud users not created within the last 7 days from the User Group 'New Hires'
Get-JCUser | Select-Object username, @{name='Attribute Value'; expression={$_.attributes.value}} | Where-Object 'Attribute Value' -Like *Marketing* | Remove-JCUserGroupMember -GroupName Sales
Removes all JumpCloud users with a custom attribute value which contains 'Marketing' from the JumpCloud User Group 'Sales'. Note that to access the value of a nested property you must use Select-Object to access the nested property. In this example a calculated property is also used.
Use the -ByID parameter when either the UserID or GroupID is passed over the pipeline to the Add-JCUserGroupMember function. The -ByID SwitchParameter will set the ParameterSet to 'ByID' which will increase the function speed and performance.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: ByID
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The GroupID is used in the ParameterSet 'ByID'. The GroupID for a User Group can be found by running the command: PS C:\> Get-JCGroup -type 'User'
Type: System.String
Parameter Sets: ByID
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The name of the JumpCloud User Group that you want to remove the User from.
Type: System.String
Parameter Sets: ByName
Aliases: name
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: System.String
Parameter Sets: ByID
Aliases: name
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The _id of the User which you want to remove from the User Group. To find a JumpCloud UserID run the command: PS C:\> Get-JCUser | Select username, _id
The UserID will be the 24 character string populated for the _id field. UserID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically using the Get-JCUser function before calling Remove-JCUserGroupMember. This is shown in EXAMPLES 2, 3, and 4.
Type: System.String
Parameter Sets: ByID
Aliases: _id, id
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The Username of the JumpCloud user you wish to remove from the User Group.
Type: System.String
Parameter Sets: ByName
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Wiki Home
- Installing the JumpCloud PowerShell module
- Using the JumpCloud PowerShell Module
- Using the JumpCloud PowerShell Module with AWS Lambda
- PowerShell Commands Example Library
- JumpCloud Commands Gallery
- JumpCloud PowerShell YouTube Channel
- The JumpCloud Dashboard PowerShell Module
Authentication
Import and Backup
- Get JCAssociation
- New JCImportTemplate
- Import JCUsersFromCSV
- Update JCUsersFromCSV
- Get JCBackup
- Send JCPasswordReset
- Backup JCOrganization
RADIUS Reply Attributes
- Add JCRadiusReplyAttribute
- Get JCRadiusReplyAttribute
- Update JCUsersFromCSV
- Set JCRadiusReplyAttribute
- Remove JCRadiusReplyAttribute
User Functions
Administrator Functions
System Functions
- Get JCSystem
- Get JCSystemApp
- Get JCSystemKB
- Set JCSystem
- Remove JCSystem
- Get JCSystemUser
- Set JCSystemUser
- Add JCSystemUser
- Remove JCSystemUser
Command Functions
- New JCCommand
- Get JCCommand
- Import JCCommand
- Remove JCCommand
- Set JCCommand
- Invoke JCCommand
- New JCDeploymentTemplate
- Invoke JCDeployment
- Get JCCommandResult
- Remove JCCommandResult
- Get JCCommandTarget
- Add JCCommandTarget
- Remove JCCommandTarget
Group Functions
- Get JCGroup
- New JCUserGroup
- Remove JCUserGroup
- Get JCUserGroupMember
- Add JCUserGroupMember
- Remove JCUserGroupMember
- New JCSystemGroup
- Remove JCSystemGroup
- Get JCSystemGroupMember
- Add JCSystemGroupMember
- Remove JCSystemGroupMember
- Set-JCUserGroupLDAP
Policy Functions
- Get JCPolicy
- Get JCPolicyResult
- Get JCPolicyTargetSystem
- Get JCPolicyTargetGroup
- New JCPolicy
- Set JCPolicy
Event Functions
Report Functions