Remove-SCSMRunAsAccount

Removes a RunAs account.

Syntax

Remove-SCSMRunAsAccount
      [-RunAsAccount] <UserAccount[]>
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-SCSMRunAsAccount cmdlet removes a RunAs account.

Examples

Example 1: Remove RunAs accounts by name

PS C:\>Get-SCSMRunAsAccount | Where-Object {$_.UserName -eq "Administrator"}|Remove-SCSMRunAsAccount

This command removes all RunAs accounts in which the user name is "Administrator". Note that this may cause certain workflows and other operations to fail.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsAccount

Specifies the RunAs account to be removed. Input to this parameter can be a ManagementPackSecureReference object or a UserAccount object that, for example, you can obtain from the Get-SCSMRunAsAccount cmdlet.

Type:Microsoft.EnterpriseManagement.Core.SdkUtilities.Security.UserAccount[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.EnterpriseManagement.Core.SdkUtilities.Security.UserAccount

You can pipe a RunAsAccount object to the RunAsAccount parameter of the Remove-SCSMRunAsAccount cmdlet, for example, the object that is retrieved by the Get-SCRunAsAccount cmdlet.

Outputs

None.

This cmdlet does not generate any output.