Removes a member from the specific Role of a specific database.
Remove-RoleMember [-MemberName*] <System.String> [-Database*] <System.String> [-RoleName*] <System.String>[<CommonParameters>]Add-RoleMember -DatabaseRole* <Microsoft.AnalysisSevices.Role> [-MemberName] <System.String> [<CommonParameters>]

The Remove-RoleMember cmdlet removes an exsisting member from a specific Role of a specific database depending upon the input values.

-MemberName <System.String>

  • This value is required

Name of the member who should be removed.

-Database <System.String>

  • This value is required

Database name to which the Role belongs to.

-RoleName <System.String>

  • This value is required

Role name from which the member should be removed.

-DatabaseRole <Microsoft.AnalysisSevices.Role>

Microsoft.AnalysisServices.Role object from which the member should be removed.


This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

  1. In the above examples all the roles available in Database DB1 are retrieved and stored in a temporary variable roles:
    PS SQLServer:SQLASmachineinstanceDatabasesDB1Roles> $roles=dir
                           PS SQLServer:SQLASmachineinstanceDatabasesDB1Roles>$roles[0]|Remove-RoleMember 

    The membername will be removed from the first role object available in the roles collection.

  2. The above cmdlet removes the role member user1 of foo domain from the myRole belonging to the database DB1:
    PS SQLServer:SQLASmachineinstanceDatabasesDB1Roles> Remove-RoleMember -MemberName "foouser1" -Database "DB1" -RoleName "myRole"
Additional Notes