hello everyone,
i'm new and i'm learning how to create subnets in IPAM using powershell. can someone help me ?
thank you
thank you, it's working i had to run with another account.
Did you look at the IPAM documentation on the GitHub Wiki?
when i try to run this command Invoke-SwisVerb $swis IPAM.SubnetManagement CreateSubnet @("10.10.1.0","21")
i got an access denied.
# Source: https://github.com/solarwinds/OrionSDK/wiki/IPAM-2019.4-and-higher-versions-API#create-new-subnet# Full syntax would be this:Invoke-SwisVerb -SwisConnection $SwisConnection -EntityName "IPAM.SubnetManagement" -Verb "CreateSubnet" -Arguments @("10.10.1.0", "21")# Where# $SwisConnection is the variable containing your SWIS Connection information.# "10.10.1.0" is the base address of the subnet# "21" is CIDR notation for the subnet mask.
If you aren't familiar with the SWIS connection information, I'd recommend watching SolarWinds Lab 86: An Introduction to PowerShell and the Orion API.
If you have a good connection to the SolarWinds Information Service, but still are getting the error, then your particular user doesn't have sufficient rights to build a new subnet in IPAM.
my connection to solarwinds is good, and i'am an admin. i don't understand why it doesn't work.
Import-Module SwisPowerShellAdd-PSSnapin SwisSnapin$swisCred= Get-Credential -Message "enter"$swis = Connect-Swis -Host "xx.xx.xx.xx" -Credential $SwisCred Invoke-SwisVerb -SwisConnection $swis -EntityName "IPAM.SubnetManagement" -Verb "CreateSubnet" -Arguments @("10.10.1.0", "21")
What version of IPAM are you running?
You should be only using the SwisPowerShell module and not the PSSnapin (because it's been deprecated).
I don't have IPAM in my home lab, but if I had to guess, my gut says that you might already have a subnet like that (or an overlapping one) in your environment.
yes! i can add the subnet via the console
but not via the script
Does this return anything in your PowerShell session?
Get-SwisData -SwisConnection $swis -Query "SELECT Caption FROM Orion.Nodes"
Got to ask - same user on both sides?
yes it returns the nodes..
How about if you do similar for the IPAM.SubnetManagement table? Wait... Is there even an IPAM.SubnetManagement table or only an IPAM.Subnet table? (I really need to install IPAM in my lab...)
IPAM.SubnetManagement
IPAM.Subnet
i'm using IPAM.SubnetManagement verb CreateSubnet