Tag Archives: WAPI

Let’s build a Infoblox PowerShell Module!

If you haven’t heard of it, Infoblox is making appliances and solutions for enterprise networks. One of them is the Infoblox Trinzic DDI which manages DNS, DHCP and IPAM.

Infoblox does not seem to have any plans for delivering a PowerShell module for managing their product, which is a bit weird since it would probably make it a bit easier for network admins trying to move windows engineers away from Active Directory Integrated DNS, and instead let the Infoblox appliance host all or some of their zones (which seems to be a common enough debate among enterprises).
But in their defence they have released a REST-based API for this appliance which enables administrators to basically build whatever tools they want to manage anything from DNS records to IPAM.

I’ve therefore started to build a module for managing DNS-records hosted by the Infoblox, but since my experience with this product is fairly limited, I thought I would post what I’ve done so far to get opinions from people with more experience with this product.

I’ve only done a few cmdlets (advanced functions) for managing a few common DNS record tasks. So far these are:

  • Add-IBResourceRecordA
  • Add-IBResourceRecordCName
  • Add-IBResourceRecordHost
  • Get-IBResourceRecord
  • Remove-IBResourceRecord
  • Set-IBResourceRecord

Some usage examples:

# Adding a A-record
Add-IBResourceRecordA -IPv4Address 1.2.3.4 -HostName myhost.contoso.com -GridServer $MyInfobloxGrid -Credential $MyCredential

# Adding a hundred A-records
1..100 | % { Add-IBResourceRecordA -IPv4Address 1.2.3.$_ -HostName myhost$_.contoso.com -GridServer $MyInfobloxGrid -Credential $MyCredential }

# Searching for those records
Get-IBResourceRecord -RecordType A -RecordValue myhost* -GridServer $MyInfobloxGrid -Credential $MyCredential

# Search for a record by IP-address
Get-IBResourceRecord -RecordType A -SearchField ipv4addr -RecordValue 1.2.3.4 -GridServer $MyInfobloxGrid -Credential $MyCredential

# Removing all of them
Get-IBResourceRecord -RecordType A -RecordValue myhost* -GridServer $MyInfobloxGrid -Credential $MyCredential -Passthrough | Remove-IBResourceRecord

# Add a HOST record
Add-IBResourceRecordHost -IPv4Address 1.2.3.4 -HostName myhost.contoso.com -GridServer $MyInfobloxGrid -Credential $MyCredential

# Change the IP-address of that record (A-record needs some tweaking before they work, I'm working on it...)
Get-IBResourceRecord -RecordType Host -RecordValue myhost.contoso.com -GridServer $MyInfobloxGrid -Credential $MyCredential -Passthrough | Set-IBResourceRecord -IPv4Address 4.3.2.1

# Add a CName
Add-IBResourceRecordCName -HostName cname.contoso.com  -Canonical myhost2.contoso.com -GridServer $MyInfobloxGrid -Credential $MyCredential

Screenshot:
Infoblox module in action...

This is very early in the development of this module, so it probably have a few bugs, and there are a lot of cmdlets that needs to be written!

Anyone out there that wants help or have any thoughts?

Please post a comment here or join this thread in the Infoblox community forum.

The code for this early version of the module is available at the Github repo!