This PowerShell module provides some functionality to facilitate automating backup actions of a Ubnt device over SSH.
Here are some similar projects I am working on:
- Posh-Cisco (PowerShell Cisco Module)
- Posh-FortiGate (PowerShell FortiGate Module)
- Posh-Juniper (PowerShell Juniper Module)
This module depends on the following PowerShell modules:
PS> Save-Module -Name Posh-Ubnt -Path <path>
PS> Install-Module -Name Posh-Ubnt
- Backup-UbntRunningConfig: Gets the running configuration and writes it to a file.
- Backup-UbntSystemConfig: Gets the system (startup) configuration and writes it to a file.
- Get-UbntRunningConfig: Gets the running configuration.
- Get-UbntSystemConfig: Gets the system (startup) configuration.
This PowerShell command gets the running configuration and writes it to a file.
PS> Backup-UbntRunningConfig -HostAddress "192.168.1.20" -HostPort 22 -Credential (Get-Credential) -FilePath "$([Environment]::GetFolderPath(“MyDocuments”))\running-config.txt"
Advanced Options:
- Specify the
-AcceptKey
flag to automatically accept SSH key.
This PowerShell command gets the sytem (startup) configuration and writes it to a file.
PS> Backup-UbntSystemConfig -HostAddress "192.168.1.20" -HostPort 22 -Credential (Get-Credential) -FilePath "$([Environment]::GetFolderPath(“MyDocuments”))\system-config.txt"
Advanced Options:
- Specify the
-AcceptKey
flag to automatically accept SSH key.
This PowerShell command gets the running configuration.
PS> Get-UbntRunningConfig -HostAddress "192.168.1.20" -HostPort 22 -Credential (Get-Credential)
Advanced Options:
- Specify the
-AcceptKey
flag to automatically accept SSH key.
This PowerShell command gets the system (startup) configuration.
PS> Get-UbntSystemConfig -HostAddress "192.168.1.20" -HostPort 22 -Credential (Get-Credential)
Advanced Options:
- Specify the
-AcceptKey
flag to automatically accept SSH key.
This PowerShell command gets the log messages.
PS> Get-UbntLogMessages -HostAddress "192.168.1.20" -HostPort 22 -Credential (Get-Credential)
Advanced Options:
- Specify the
-AcceptKey
flag to automatically accept SSH key.
These PowerShell functions were tested on the following Ubnt devices:
- TOUGHSwitch TS-5-PoE (SW version: 1.3.2)
- TOUGHSwitch TS-8-PRO (SW version: 1.3.2)
- Added documentation
- Added support to backup running config (Backup-UbntRunningConfig)
- Added support to backup system config (Backup-UbntSystemConfig)
- Added support to get running config (Get-UbntRunningConfig)
- Added support to get system config (Get-UbntSystemConfig)
- Added support to get log messages (Get-UbntLogMessages)
- Test on more devices
- ...