Remove-RoleMember
Removes a member from the specific Role of a specific database.
Syntax
Remove-RoleMember
-MemberName <String>
[-Database] <String>
[-RoleName] <String>
[-Server <String>]
[-Credential <PSCredential>]
[-ServicePrincipal]
[-ApplicationId <String>]
[-TenantId <String>]
[-CertificateThumbprint <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-RoleMember
-MemberName <String>
-DatabaseRole <Role>
[-Server <String>]
[-Credential <PSCredential>]
[-ServicePrincipal]
[-ApplicationId <String>]
[-TenantId <String>]
[-CertificateThumbprint <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-RoleMember
-MemberName <String>
-ModelRole <ModelRole>
[-Server <String>]
[-Credential <PSCredential>]
[-ServicePrincipal]
[-ApplicationId <String>]
[-TenantId <String>]
[-CertificateThumbprint <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-RoleMember
[-Server <String>]
[-Credential <PSCredential>]
[-ServicePrincipal]
[-ApplicationId <String>]
[-TenantId <String>]
[-CertificateThumbprint <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-RoleMember cmdlet removes an existing member from a specific Role of a specific database depending upon the input values.
Note: This cmdlet is only available for PowerShell 5. Currently, it is available for PowerShell 7 in recent **preview** versions of the module.
Examples
Example 1: Remove role member using pipeline
PS SQLServer:\SQLAS\machine\instance\Databases\DB1\Roles> $roles = Get-Children
PS SQLServer:\SQLAS\machine\instance\Databases\DB1\Roles> $roles[0] | Remove-RoleMember -MemberName "foo\user1"
Example 2: Remove role member using name
PS SQLServer:\SQLAS\machine\instance\Databases\DB1\Roles> Remove-RoleMember -MemberName "foo\user1" -Database "DB1" -RoleName "myRole"
Parameters
The application Id for the service principal.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The certificate thumbprint for the service principal.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
If this parameter is specified, the user name and password passed will be used to connect to specified Analysis Server instance. If no credentials are specified default windows account of the user who is running the tool will be used.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Database name to which the Role belongs to.
Type: | String |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Microsoft.AnalysisServices.Role object from which the member should be removed. (Multidimensional metadata only)
Type: | Role |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Name of the member who should be removed.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The pipeline role object.
Type: | ModelRole |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Role name from which the member should be removed.
Type: | String |
Position: | 2 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Optionally specifies the server instance to connect to if not currently in the SQLAS Provider directory.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that this connection is using service principal.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The tenant Id for the service principal.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.AnalysisServices.Role
Microsoft.AnalysisServices.Tabular.ModelRole
Notes
Supported on all Analysis Services instances