Remove-NAVServerUser

Deletes a Business Central user.

Syntax

Remove-NAVServerUser
      [-Tenant <TenantId>]
      -WindowsAccount <String>
      [-ServerInstance] <String>
      [-Force]
      [-ProgressAction <ActionPreference>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-NAVServerUser
      [-Tenant <TenantId>]
      -Sid <String>
      [-ServerInstance] <String>
      [-Force]
      [-ProgressAction <ActionPreference>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-NAVServerUser
      [-Tenant <TenantId>]
      -InputObject <DataRow>
      [-ServerInstance] <String>
      [-Force]
      [-ProgressAction <ActionPreference>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-NAVServerUser
      [-Tenant <TenantId>]
      -UserName <String>
      [-ServerInstance] <String>
      [-Force]
      [-ProgressAction <ActionPreference>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Use the Remove-NAVServerUser cmdlet to delete a Business Central user from a specified database or tenant database that is connected to a Business Central Server instance.

Examples

EXAMPLE 1

Remove-NAVServerUser MicrosoftDynamicsNavServer -Sid S-1-5-20

This example deletes a Business Central user from the database that is connected to the Business Central Server server instance that has the name MicrosoftDynamicsNavServer. The user is identified by the security identifier.

EXAMPLE 2

Remove-NAVServerUser MicrosoftDynamicsNavServer -WindowsAccount cronus\chris

This example deletes a Business Central. The user is identified by the Windows account user name.

EXAMPLE 3

Remove-NAVServerUser MicrosoftDynamicsNavServer -UserName USER2

This example deletes a Business Central. The user is identified by the user name in Business Central.

EXAMPLE 4

Get-NAVServerUser MicrosoftDynamicsNavServer | Remove-NAVServerUser MicrosoftDynamicsNavServer

This example uses piping to delete all Business Central users for the Business Central Server instance with the name MicrosoftDynamicsNavServer.

Parameters

-Confirm

Prompts you for confirmation before executing the command.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specifies the DataRow object that identifies the user to remove. You can pass this object from the Get-NAVServerUser cmdlet.

Type:DataRow
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ProgressAction

A common PowerShell parameter that determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider. Learn more.

Type:ActionPreference
Aliases:proga
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServerInstance

Specifies the name of a Business Central Server instance, for example, BC or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Sid

A security identifier (SID) for the Business Central user to delete. The SID is a unique value that identifies a Windows user account. You can use the Sid, UserName, or WindowsAccount parameters to identify the user. If you use the Sid parameter, then do not set the UserName or WindowsAccount parameters.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Tenant

Specifies the ID of the tenant that the user is stored in, such as Tenant1. This parameter is required unless the specified service instance is not configured to run multiple tenants.

Type:TenantId
Aliases:Id
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UserName

Specifies the user name of a Business Central user to delete. The user name is defined by the User Name field in a user's account in Business Central. You can use the UserName, WindowsAccount or Sid parameters to identify the user. If you use the Username parameter, then you cannot use the Windows Account or Sid parameters.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WindowsAccount

Specifies the Windows user name of the Business Central user to delete. The value has the domain\username format. You can use the WindowsAccount, UserName, or Sid parameters to identify the user. If you use the WindowsAccount parameter, then you cannot use the UserName or Sid parameters.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

You can pipe a string that contains a Business Central Server instance name and tenant ID, if applicable, to the cmdlet.

System.Data.DataRow

You can pass this object from the Get-NAVServerUser cmdlet to remove a user.

Outputs

None