Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

IPAM - Making the subnet you query for a variable

$
0
0

I am trying to use the information from this post How to use the IPAM API and get "Free IP Address" to build a way to automatically get the next available ip, the gateway, and the subnet mask in a script.  I want this to prompt the user for which subnet they want to use.  I'm also doing this via invoke-command.  Below is an example line from my powershell script:

 

$AvailableIPs = Invoke-Command -ScriptBlock {Get-SwisData $swis 'SELECT DISTINCT TOP 1 I.DisplayName FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.DisplayName = ''DEV'''} -Session $session

 

I want to change DEV to be $subnet but I cannot just drop in $subnet and have it work (the variable does exist on the remote session).

 

Any help is much appreciated.


Viewing all articles
Browse latest Browse all 2677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>