Use the Set-NAVServerInstance cmdlet to change the service state of a Business Central Server instance.
For example, you can change the service state from Stopped to Running.
You can also use this cmdlet to change the service account for a server instance.
Examples
EXAMPLE 1
Set-NAVServerInstance MyInstance -Restart -Verbose
VERBOSE: NavCommand.BeginProcessing
VERBOSE: NavCommand.ProcessRecord
VERBOSE: Performing operation "Set-NAVServerInstance" on Target "ServerInstance = MicrosoftDynamicsNavServer$MyInstance, Start = False, Stop = False, Restart = True".
VERBOSE: Attempting to stop service MyInstance
VERBOSE: Service MicrosoftDynamicsNavServer$MyInstance is stopped
VERBOSE: Service HTTP is already running
VERBOSE: Attempting to start service MicrosoftDynamicsNavServer$NewInstance
VERBOSE: Service MicrosoftDynamicsNavServer$NewInstance is running
VERBOSE: NavCommand.EndProcessing
This example uses the Set-NAVServerInstance cmdlet to restart a Business Central Server instance.
The Verbose parameter specifies that progress information is to be written to the console.
Parameters
-Confirm
Prompts you for confirmation before executing the command.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Force
Forces the command to run without asking for user confirmation.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Restart
Restarts the Business Central Server instance.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
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.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
True
Value from remaining arguments:
False
-ServiceAccount
Specifies the Windows-based computer account that the Business Central Server instance is to use to log on.
Only NetworkService and Windows User values are supported.
Parameter properties
Type:
ServiceAccount
Default value:
None
Accepted values:
LocalService, NetworkService, LocalSystem, User
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ServiceAccountCredential
Specifies a set of security credentials that must be used when configuring the service account.
Parameter properties
Type:
PSCredential
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Start
Starts the Business Central Server instance.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Stop
Stops the Business Central Server instance.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Describes what would happen if you executed the command without actually executing the command.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Inputs
System.String
You can pipe a string that contains a Business Central Server instance name to the cmdlet.