Remove-SCSMUserRole
Remove-SCSMUserRole
Removes a user role from Service Manager.
Syntax
Parameter Set: Default
Remove-SCSMUserRole [-UserRole] <Role[]> [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-SCSMUserRole cmdlet removes a user role from Service Manager. Some user roles are designated as system user roles, and cannot be removed. You can run the following command to display the issystem attribute of all user role objects.
Get-SCSMUserRole|ft DisplayName,{$_.userrole.issystem} -au
If the user role cannot be removed, a non-terminating error will be reported.
Parameters
-UserRole<Role[]>
Specifies the UserRole object from which to remove the user.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.EnterpriseManagement.ServiceManager.Sdk.UserRoles.Role
You can pipe a user role to the UserRole parameter of the Remove-SCSMUserRole cmdlet. For example, an object such as that returned by the Get-SCSMUserRole cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None.
This cmdlet does not generate any output.
Examples
-------------------------- EXAMPLE 1 --------------------------
These commands retrieve and then remove the CustomUser user role.
PS C:\>Get-SCSMUserRole
PS C:\>Get-SCSMUserRole “New Role” | Remove-SCSMUserRole