Get-CacheLogs
This fetches a specified log file from the cache server and places it at the specified destination on the machine. You can also specify multiple log files or all log files to be fetched and placed at the desired location.
Get-CacheLogs -Server -FileNames `
[-TlsCertPath] [-TlsCertPassword] `
-Destination [-NoLogo]
Examples
- This command copies log file(s) from server 20.200.20.11 to the destination directory.
Get-CacheLogs -FileNames "defaultCache_18-5-2025-10-45-38_20.200.20.34" `
-Destination "C:\Logfile-path" -Server 20.200.20.11
- This command copies all the files from the server to the destination directory.
Get-CacheLogs -FileNames * -Destination "C:\Logfile-path" -Server 20.200.20.11
- This command downloads the specified cache log files from the server with mutual TLS (mTLS) enabled to C:\Users\administrator\Desktop\LogFiles. It runs from a machine where NCache is not installed and uses C:\certs\client.pem to 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.
Get-CacheLogs -Server 20.200.20.11 -FileNames
"defaultCache_18_18-5-2020-10-45-38_20.200.20.34,defaultClusteredCache_18-5-2020-9-34-25_20.200.20.34" `
-Destination "C:\Logfile-path" -TlsCertPath "C:\certs\client.pem" `
-TlsCertPassword "clientKeyPassword"
- This command copies log file(s) from server 20.200.20.11 to the destination directory, using security credentials.
Get-CacheLogs -FileNames "defaultCache_18-5-2025-10-45-38_20.200.20.34" `
-Destination "C:\Logfile-path" -Server 20.200.20.11 `
-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 |
|---|---|---|---|
-Server* |
<String> |
Specifies a server name where the NCache Service is running and a cache with the specified cache-name is registered, and specifies the server address where the log files are residing. | - |
-FileNames* |
<String> |
Specifies the name of the log file (with file name extension) which needs to be copied to the target path provided. NOTE: Comma-separated log file names must be specified in case of multiple files. To select all files, use asterisk (*). |
- |
-Destination* |
<String> |
Specifies the location where the log files need to be copied to your machine. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | 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. |
- |
-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. |
- |