Solarwinds

  • Add multiple IP ranges to IPAM 22 September, 2019 by Joey

    Simple Powershell script to add multiple networks to the IPAM of SolarWinds.

    Add-PSSnapin SwisSnapin
    $creds = Get-Credential
    $swis = Connect-Swis -Credential $creds -Hostname localhost 
    $Sitename = Read-Host -Prompt 'What will be the site name?'
    $Mgtnetwork = Read-Host -Prompt 'What will be the first two octets of the management subnets (e.g. 172.16)?'
    
    New-SwisObject $swis -EntityType 'IPAM.Subnet' -Properties @{Address="$Mgtnetwork.100.0"; FriendlyName="$Sitename $Mgtnetwork.100.x"; Comments='Subnet 1'; VLAN='100'; CIDR=24; Location="$Sitename"; ScanInterval="1440"}
    
    New-SwisObject $swis -EntityType 'IPAM.Subnet' -Properties @{Address="$Mgtnetwork.200.0"; FriendlyName="$Sitename $Mgtnetwork.200.x"; Comments='Subnet 2'; VLAN='200'; CIDR=24; Location="$Sitename"; ScanInterval="1440"}
    

Leave a Reply

Your email address will not be published. Required fields are marked *