Export-Configuration
This cmdlet exports the specified configuration type from an NCache server. Depending on the selected type, it can export cache configurations and deployed server-side modules, node security settings, NCache service settings, TLS configurations, or bridge configurations.
The exported configuration is saved to an ncexport-<server> folder within the specified path. When exporting a single cache or bridge, the folder is named ncexport-<server>-<name>.
Export-Configuration -Path -Type `
[-Name] [-Server] `
[-Port] [-DoNotExportModules] `
[-TlsCertPath] [-TlsCertPassword] `
[-Credentials] [-NoLogo]
Examples
- This command exports the complete configuration of the server 20.200.20.11 into the
ncexport-20.200.20.11folder created within the specified directory.
Export-Configuration -Type All -Server 20.200.20.11 `
-Path C:\Desktop\config
- This command exports the configuration of defaultCache along with its deployed server-side modules into the
ncexport-20.200.20.11-defaultCachefolder created within the specified directory.
Export-Configuration -Type Cache -Name defaultCache `
-Server 20.200.20.11 -Path C:\Desktop\config
- This command exports only the configuration of defaultCache without its deployed server-side modules.
Export-Configuration -Type Cache -Name defaultCache `
-Server 20.200.20.11 -Path C:\Desktop\config `
-DoNotExportModules
- This command exports the node security configuration of the server listening at the specified port.
Export-Configuration -Type Security -Server 20.200.20.11 `
-Port 9802 -Path C:\Desktop\config
- This command exports all NCache configurations from the specified server with mutual TLS (mTLS) enabled to
C:\Desktop\config. It runs from a machine where NCache is not installed and usesC:\certs\client.pemto authenticate the machine running the cmdlet. The-TlsCertPasswordparameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Export-Configuration -Type All -Server 20.200.20.11 `
-Path C:\Desktop\config -TlsCertPath "C:\certs\client.pem" `
-TlsCertPassword "clientKeyPassword"
- This command exports the complete configuration of the server 20.200.20.11 into the
ncexport-20.200.20.11folder created within the specified directory, using security credentials.
Export-Configuration -Type All -Server 20.200.20.11 `
-Path C:\Desktop\config -Credentials(Get-Credential john_smith)
Properties
Note
The parameters with asterisk (*) on their names are the required parameters and the rest are optional.
| Parameters | Data Types | Description | Default Value |
|---|---|---|---|
-Path* |
<String> |
Specifies the path of the directory where the configuration is exported. | - |
-Type* |
<ConfigurationType> |
Specifies the type of configuration to be exported. Possible values: - NCacheService - Security - Bridge - Cache - TLS - All |
All |
-Name |
<String> |
Specifies the name of the item within the specified type i.e., the name of the cache when the type is Cache and the name of the bridge when the type is Bridge. This parameter is ignored when the type is All. | - |
-Server |
<String> |
Specifies a server name where the NCache Service is running. | - |
-Port |
<Integer> |
Specifies the port on which NCache server is listening. | 9803 |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |
-DoNotExportModules |
<SwitchParameter> |
This switch omits the export of the deployed server-side modules, allowing users to export only the configuration files. | False |
-TlsCertPath |
<string> |
Path to the client PEM certificate used to authenticate the machine running the NCache PowerShell cmdlet when connecting to an NCache server with mutual TLS (mTLS) enabled. The PEM file must contain the private key, leaf certificate, and any intermediate certificates. You can generate a certificate using New-NCacheTlsCertificate. This parameter is required when running the PowerShell module from a machine where NCache is not installed and the server requires mTLS. On a machine with an NCache server installation, the node's own certificate is used automatically. Relative paths are resolved against the current PowerShell location, and the file must exist. To configure the certificate presented by the server, use -CustomCertificatePath. |
False |
-TlsCertPassword |
<string> |
Password used to load the encrypted private key in the PEM file specified by -TlsCertPath. Required only when the private key is password-protected. Not needed for an unencrypted private key. The password is used only to load the client certificate for the current command's connections. It is not saved in the NCache server configuration. |
False |
-Credentials |
<pscredential> |
Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user with the appropriate permissions at the node. | - |