Remove-SqlUser

Removes a user from a database.

Syntax

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

Detailed Description

The Remove-SqlUser function removes a user from the specified database.

Related Commands

* Remove-SqlUser

Parameters

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

Input Type

None You cannot pipe objects to Remove-SqlUser

Return Values

None This function does not generate any output.

Examples

EXAMPLE 1

Remove-SqlUser "Z002\sql2k8" "pubs" "TestPSUnit"
This command Removes the TestPSUnit user from the pubs database.

EXAMPLE 2

$database = Get-SqlDatabase "Z002\sql2k8" "pubs"
Remove-SqlUser -dbname $database "TestPSUnit"
This command Removes the TestPSUnit user from the pubs database.