PowerNetbox is a powerful PowerShell module designed to work seamlessly with the Netbox REST API. Offering complete 100% coverage of all Netbox 4.x API endpoints, this module facilitates efficient management of network resources. Built on the foundation of the original NetboxPS, it ensures compatibility and extends functionality for users.
PowerNetbox is a comprehensive PowerShell module designed to interact with the Netbox REST API, providing full support for all endpoints in Netbox 4.4.8. With 100% API coverage, this module is essential for managing network infrastructure effectively.
This module comprises various components, each with dedicated functionality:
| Module | Endpoints | Functions | Status |
|---|---|---|---|
| DCIM | 45 | 180 | ✅ Full |
| IPAM | 18 | 72 | ✅ Full |
| Virtualization | 5 | 20 | ✅ Full |
| Circuits | 11 | 44 | ✅ Full |
| Tenancy | 5 | 20 | ✅ Full |
| VPN | 10 | 40 | ✅ Full |
| Wireless | 3 | 12 | ✅ Full |
| Extras | 12 | 45 | ✅ Full |
| Core | 5 | 8 | ✅ Full |
| Users | 4 | 16 | ✅ Full |
| Branching* | 3 | 16 | ✅ Full |
*Branching capability requires the netbox-branching plugin for staging changes.
Connecting to Netbox is straightforward:
# Import the module
Import-Module PowerNetbox
# Connect using API token
$credential = Get-Credential -UserName 'api' -Message 'Enter your Netbox API token'
Connect-NBAPI -Hostname 'netbox.example.com' -Credential $credential
Manage devices and IP addresses effortlessly:
# Retrieve all devices
Get-NBDCIMDevice
# Create a new IP address
New-NBIPAMAddress -Address '10.0.0.1/24' -Description 'Web Server'
# Update a device's description
Set-NBDCIMDevice -Id 1 -Description 'Updated description'
# Remove a device with confirmation
Remove-NBDCIMDevice -Id 1
PowerNetbox also supports advanced operations, including branching for staging changes. For example:
# Create and enter a new branch
New-NBBranch -Name "feature/new-datacenter" -Description "Planning new DC"
Enter-NBBranch -Name "feature/new-datacenter"
New-NBDCIMSite -Name "DC-New" -Slug "dc-new"
New-NBDCIMDevice -Name "server01" -DeviceType 1 -Site 1
Exit-NBBranch
For users transitioning from earlier versions, the following command ensures a smooth update:
# Uninstall old modules
Remove-Module NetboxPS, NetboxPSv4 -Force -ErrorAction SilentlyContinue
Uninstall-Module NetboxPS, NetboxPSv4 -Force -ErrorAction SilentlyContinue
# Install PowerNetbox
Install-Module -Name PowerNetbox -Scope CurrentUser
# Import new module
Import-Module PowerNetbox
Access comprehensive documentation, examples, and troubleshooting tips on the PowerNetbox Wiki or consult the official Netbox API Documentation.
PowerNetbox represents a significant enhancement for network management professionals utilizing PowerShell, offering a stable and feature-rich environment for interacting with Netbox.
No comments yet.
Sign in to be the first to comment.