Remove-SqlServerRoleMember

Removes a login from a server role.

Syntax

Remove-SqlServerRoleMember [-sqlserver] <Object> [-loginame] <String> [-rolename] <String> [<CommonParameters>]

Detailed Description

The Remove-SqlServerRoleMember function removes a login from the specified server role.

Related Commands

* Remove-SqlServerRoleMember

Parameters

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

Input Type

None You cannot pipe objects to Remove-SqlServerRoleMember

Return Values

None This function does not generate any output.

Examples

EXAMPLE 1

Remove-SqlServerRoleMember "Z002\sql2k8" "TestPSUnit" "bulkadmin"
This command Removes the TestPSUnit login from the bulkadmin server role.

EXAMPLE 2

$server = Get-SqlServer "Z002\sql2k8"
Remove-SqlServerRoleMember $server "TestPSUnit" "bulkadmin"
This command Removes the TestPSUnit login from the bulkadmin server role.