This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Orion API Update Custom Property True/False using PowerShell

PURPOSE: Update any Custom Property field that has True/False value. You can run this using command line to set properties so that you do not need to modify the Powershell script ever.

WARNING: See Known Issues about ICMP Based Nodes and workaround is included in this script.

Why is this script so useful?

  • I built this so if you have next to no powershell but have ran a few batch, bash, or other cli interface, you can invoke without modification.
  • I commented out all pertinent information to ensure that anyone can use and modify this script as needed since you can invoke outside the script allows for lots of flexibility.

To Run

Download the Orion SDK

Install Orion SDK on the system for the Powershell supportability.

Run script in Powershell command-line as follows to set custom property comments to true

./<scriptName.ps1> -ip <Nodewearemodifying> -username <user> -password <pass> -customnode comments -positive

Run script in Powershell command-line as follows to set custom property city to false

./<scriptName.ps1> -ip <Nodewearemodifying> -username <user> -password <pass> -customnode city

If you modify the script and set default credentials, you can just simply use the following to execute as needed,:

./<scriptName.ps1> -ip <NodeIPAddress>

If you run into an error about execution, you can bypass per session by executing this first:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

You can set the following Parameters in command line.

-OrionServer Hostname/IP

-Username

-Password

-CustomNode (CustomPropertyName)

-positive (Sets CustomProperty value True, if not used, sets to False) I tried -true, but it interferes with powershell.

Why is this so accurate?

     I have logic built into to search the Orion.IPAddresses to cross reference the correct NodeID. This way I can search any IP associated to a switch and not just the polled IP.

KNOWN ISSUES and Workaround:

Enable Line 45 and disable line 47 to change behavior, but introduces issue, you can only can search polled IP.

  • ICMP Polled VM Hosts return an error, need to reference the Orion.Nodes Table for these.
  • ICMP Polled Nodes return an error, need to reference the Orion.Nodes Table for these.
CustomUpdate.ps1