New-NAVServerConfiguration

New-NAVServerConfiguration

Creates a new configuration with default values, or to replace the existing configuration for a Microsoft Dynamics NAV Server instance.

Syntax

Parameter Set: __AllParameterSets
New-NAVServerConfiguration [[-ServerInstance] <String> ] [ <CommonParameters>]

Parameter Set: NewServerSettingsDocument
New-NAVServerConfiguration [-ServerSettingsDocument <XmlNode> ] [ <CommonParameters>]

Detailed Description

Use the New-NAVServerConfiguration cmdlet to create a new configuration with default values, or to replace the existing configuration for a Microsoft Dynamics NAV Server instance.

Use the New-NAVServerConfiguration cmdlet without arguments to create a new configuration with default values. The cmdlet returns an XML document that contains default configuration settings for a Microsoft Dynamics NAV Server instance.

Use New-NAVServerConfiguration with the -ServerInstance and -ServerSettingsDocument parameters to replace the existing configuration for a Microsoft Dynamics NAV Server instance.

Parameters

-ServerInstance<String>

Specifies the name of a Microsoft Dynamics NAV Server instance. The default instance name is DynamicsNAV70. You can specify either the full name of an instance (such as MicrosoftDynamicsNavServer$myinstance) or the short name (such as myinstance).

If you specify a Microsoft Dynamics NAV Server instance, the configuration replaces the current configuration for that instance. A new CustomSettings.config file is created in the service directory for the instance, overwriting any existing CustomSettings.config file.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-ServerSettingsDocument<XmlNode>

Specifies the Microsoft Dynamics NAV Server instance configuration document in XML format. You cannot specify a ServerSettingsDocument unless you also specify a ServerInstance. For more information, see Example 2.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String

    You can pipe a string that contains a Microsoft Dynamics NAV Server instance name or the Microsoft Dynamics NAV Server instance configuration XML document to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.Xml.XmlDocument

    Returns the configuration information as an XML document.

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

This example returns an XML document that contains the default configuration details for a Microsoft Dynamics NAV Server instance.

C:\PS>New-NAVServerConfiguration | fc

class XmlDocument
{
xml = version="1.0" encoding="utf-8"
appSettings =
class XmlElement
{
#comment =
[

The network protocol used to access the database.
Valid options: Default, NamedPipes, Sockets


Name of the database server to connect to.


Name of the database instance to connect to.


Name of the database to connect to.

...
]

add =
[
class XmlElement
{
key = NetworkProtocol
value = Default
}
class XmlElement
{
key = DatabaseServer
value = .
}
class XmlElement
{
key = DatabaseInstance
value =
}
class XmlElement
{
key = DatabaseName
value = Demo Database NAV (6-0)
}
...
]

}
}

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This example saves a Microsoft Dynamics NAV Server configuration to a variable and then uses that variable to create a new CustomSettings.config file for the MyInstance instance.

C:\PS>$xml = New-NAVServerConfiguration
New-NavServerConfiguration -ServerInstance MyInstance -ServerSettingsDocument $xml