Remove-SqlDatabaseRoleMember

Removes a user or role from a database role.

Syntax

Remove-SqlDatabaseRoleMember [[-sqlserver] <Object>] [-dbname] <Object> [-name] <String> [-rolename] <String> [<CommonParameters>]

Detailed Description

The Remove-SqlDatabaseRoleMember function removes a user or role from the specified database role.

Related Commands

* Remove-SqlDatabaseRoleMember

Parameters

Name Description Required? Pipeline Input Default Value
sqlserver    false  false   
dbname    true  false   
name    true  false   
rolename    true  false   

Input Type

None You cannot pipe objects to Remove-SqlDatabaseRoleMember

Return Values

None This function does not generate any output.

Examples

EXAMPLE 1

Remove-SqlDatabaseRoleMember "Z002\sql2k8" "pubs" "TestPSUnit" "TestPSUnitDBRole"
This command removes the TestUnit user to the TestPSUnitDBRole database role.

EXAMPLE 2

$database = Get-SqlDatabase "Z002\sql2k8" "pubs"
Remove-SqlDatabaseRoleMember -dbname $database -name "TestPSUnit" -rolename "TestPSUnitDBRole"
This command removes the TestUnit user to the TestPSUnitDBRole database role.