### Install Orion SDK with Chocolatey Source: https://github.com/solarwinds/orionsdk/blob/master/README.md Installs the Orion SDK tools using the Chocolatey package manager. This is a convenient way to get started if you have Chocolatey installed. ```bash choco install orionsdk ``` -------------------------------- ### Installing the PowerOrion Module Source: https://github.com/solarwinds/orionsdk/wiki/PowerOrion---A-Module-for-PowerShell Provides instructions for installing the PowerOrion module using the `Install-Module` cmdlet in PowerShell. This is the recommended method for users with access to the PowerShell Gallery. ```PowerShell Install-Module PowerOrion ``` -------------------------------- ### SWIS REST Query Request Example Source: https://github.com/solarwinds/orionsdk/wiki/REST Demonstrates a GET request to the SWIS REST API for querying data. It specifies the endpoint, query parameters, and authentication headers. ```text GET https://localhost:17774/SolarWinds/InformationService/v3/Json/Query?query=SELECT+Uri+FROM+Orion.Pollers+ORDER+BY+PollerID+WITH+ROWS+1+TO+3+WITH+TOTALROWS HTTP/1.1 Authorization: Basic YWRtaW46 User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3 Host: localhost:17774 Accept: */* ``` -------------------------------- ### Installing and Importing SwisPowerShell Module Source: https://github.com/solarwinds/orionsdk/wiki/SwisPowerShell-A-Module-for-PowerShell Provides instructions on how to install the SwisPowerShell module using PowerShell Gallery and then load it into the current session for use. It also shows how to list all available commands within the module. ```PowerShell Install-Module SwisPowerShell ``` ```PowerShell Import-Module SwisPowerShell ``` ```PowerShell Get-Command -Module SwisPowerShell ``` ```PowerShell Get-Help About_Modules ``` -------------------------------- ### PowerShell Examples for IPAM Operations Source: https://github.com/solarwinds/orionsdk/wiki/IPAM-4.6-API Provides practical PowerShell examples for interacting with the SolarWinds Orion SDK to manage IPAM data. Includes samples for creating, updating, and deleting subnets and IP nodes. ```PowerShell # Delete IPAM Subnet Remove-SwisObject $swis -Uri 'swis://localhost/Orion/IPAM.Subnet/SubnetId=106,ParentId=101' # Update IPAM Subnet Set-SwisObject $swis -Uri 'swis://localhost/Orion/IPAM.Subnet/SubnetId=100,ParentId=2' -Properties @{VLAN='test';CIDR=22} # Create IPAM Subnet New-SwisObject $swis -EntityType 'IPAM.Subnet' -Properties @{Address='10.199.252.1'; CIDR=24;} # Delete IPAM IPNode Remove-SwisObject $swis -Uri 'swis://localhost/Orion/IPAM.IPNode/IpNodeId=2' # Update IPAM IPNode Set-SwisObject $swis -Uri 'swis://localhost/Orion/IPAM.IPNode/IpNodeId=2' -Properties @{ Alias = 'test1' } # Create IPAM IPNode New-SwisObject $swis -EntityType 'IPAM.IPNode' -Properties @{ SubnetId=22; IPAddress='10.20.30.40' } # Create IPAM IPNode Attribute New-SwisObject $swis -EntityType 'IPAM.IPNodeAttr' -Properties @{ IPNodeId = 1; } # Update IPAM IPNode Attribute Set-SwisObject $swis -Uri 'swis://localhost/Orion/IPAM.IPNode/IpNodeId=1/Custom' -Properties @{ Custom_1 = 'test1' } # Delete IPAM IPNode Attribute Remove-SwisObject $swis -Uri 'swis://localhost/Orion/IPAM.IPNode/IpNodeId=1/Custom' ``` -------------------------------- ### PowerShell Example: Create Custom Property Source: https://github.com/solarwinds/orionsdk/wiki/Managing-Custom-Properties Demonstrates how to connect to the Orion server and invoke the `CreateCustomProperty` verb using PowerShell. ```PowerShell $swis = Connect-Swis -Hostname localhost -Username admin -Password "" Invoke-SwisVerb $swis Orion.NodesCustomProperties CreateCustomProperty @("Test1", "this is my description", "string", 4000, $null, $null, $null, $null, $null, $null) ``` -------------------------------- ### IPAM API Documentation Source: https://github.com/solarwinds/orionsdk/wiki/IPAM-4.6-API This section details the IPAM API methods for managing DNS PTR records, IP addresses, and subnets within SolarWinds Orion. It covers adding and removing PTR records, retrieving the first available IP in a subnet, changing the status of an IP node, managing IP address reservations (start, finish, cancel), and creating new subnets. Each method includes its signature, parameter descriptions, return values, and usage examples. ```APIDOC IPAM.IPAddressManagement: AddPtrRecord(recordName: string, recordData: string, dnsIpAddress: string, dnsZoneName: string) Adds a PTR record to a DNS zone without creating an A record. Parameters: recordName: The name of the DNS record. recordData: The data for the DNS record (e.g., IP address). dnsIpAddress: The IP address of the DNS server. dnsZoneName: The name of the DNS zone. Returns: A message indicating the status of the operation. RemovePtrRecord(recordName: string, dnsIpAddress: string, dnsZoneName: string, isRetryingDnsZoneSearch: bool = false) Removes a PTR record from a DNS zone. Parameters: recordName: The name of the DNS record to remove. dnsIpAddress: The IP address of the DNS server. dnsZoneName: The name of the DNS zone. isRetryingDnsZoneSearch: If true, searches other DNS zones if the record is not found in the specified zone. Returns: A message indicating the status of the operation. IPAM.SubnetManagement: GetFirstAvailableIp(subnetAddress: string, subnetCidr: string) Retrieves the first available IP address within a specified subnet. Parameters: subnetAddress: The IP address representing the subnet (e.g., "199.10.1.0"). subnetCidr: The CIDR notation for the subnet (e.g., "24"). Returns: The first available IP address from the subnet. Note: Does not change the status of the returned IP node. ChangeIpStatus(ipAddress: string, status: string) Changes the status of a specific IP node. Parameters: ipAddress: The IP address of the node to update (e.g., "199.10.1.1"). status: The new status for the IP node. Possible values: "Used", "Available", "Reserved", "Transient", "Blocked". StartIpReservation(subnetAddress: string, subnetCidr: string, reservationTimeInMinutes: int = 10) Initiates a reservation for an IP address within a subnet. Parameters: subnetAddress: The IP address representing the subnet. subnetCidr: The CIDR notation for the subnet. reservationTimeInMinutes: The duration of the reservation in minutes (defaults to 10). Returns: The reserved IP address. Note: When the reservation time expires, the IP node's status is set to 'Available'. FinishIpReservation(ipAddress: string, finalIpStatus: string) Completes an IP address reservation with a specified final status. Parameters: ipAddress: The IP address that was reserved. finalIpStatus: The final status for the IP address. Possible values: "Used", "Available", "Reserved", "Transient", "Blocked". CancelIpReservation(reservedIpAddress: string) Cancels an ongoing IP address reservation. Parameters: reservedIpAddress: The IP address that is currently reserved. CreateSubnet(subnetAddress: string, rawCidr: string) Creates a new subnet within the IPAM group tree, placed under the root folder. Parameters: subnetAddress: The IP address for the new subnet. rawCidr: The CIDR notation for the new subnet. Possible Errors: Overlapping with existing subnets. ``` -------------------------------- ### Create WMI Credentials (PowerShell Example) Source: https://github.com/solarwinds/orionsdk/wiki/Credential-Management Example of how to create WMI (UserPassword) credentials using the Orion SDK with PowerShell. This snippet demonstrates invoking the `CreateUsernamePasswordCredentials` verb with a specified name, username, and password. ```powershell # create WHMI credentials guest/guest with name=custom # credentialId can be used in discovery plugin configuration $credentialId = Invoke-SwisVerb $swis Orion.Credential CreateUsernamePasswordCredentials @( "custom", "guest", "guest" ) ``` -------------------------------- ### Install SwisPowerShell Module Source: https://github.com/solarwinds/orionsdk/wiki/PowerShell Installs the SwisPowerShell module from the PowerShell Gallery. Requires administrator privileges. ```PowerShell Install-Module -Name SwisPowerShell ``` -------------------------------- ### Create SNMP Credentials (PowerShell Example) Source: https://github.com/solarwinds/orionsdk/wiki/Credential-Management Example of how to create SNMP credentials using the Orion SDK with PowerShell. This snippet demonstrates invoking the `CreateSNMPCredentials` verb with a specified name and community string. ```powershell # create SNMP credentials with name=custom, community=RO_permanent # credentialId can be used in discovery plugin configuration $credentialId = Invoke-SwisVerb $swis Orion.Credential CreateSNMPCredentials @( "custom", "RO_permanent" ) ``` -------------------------------- ### SWIS Uri Format and Examples Source: https://github.com/solarwinds/orionsdk/wiki/Uris Details the structure of a SWIS Uri, including the system identifier, endpoint, entity type, and key filter. Provides examples of common Uri patterns. ```APIDOC URI Format: swis://///[/