Comments
-
$ServerName = "LS-TAD" $ip = ([System.Net.Dns]::GetHostAddresses($ServerName)).IPAddressToString if ($ip -is [array]) { foreach ($ipaddr in $ip) { # Strip IPv6 address if ($ipaddr.contains(".")){$ip=$ipaddr} } } $ip.GetType() $txtIp = "123.12.0.2" $txtIp.GetType() IsPublic IsSerial Name BaseType -------- -------- ----…
-
Interesting. I've found the culprit, though I don't understand why. When I use $ip = ([System.Net.Dns]::GetHostAddresses($ServerName)).IPAddressToString if ($ip -is [array]) { foreach ($ipaddr in $ip) { # Strip IPv6 address if ($ipaddr.contains(".")){$ip=$ipaddr} } } rather than directly hardcoding the IP: $ip =…
-
No, the odd thing is, after running from a command line "powershell -version 2" and running the script, then it no longer errors even in the ISE. Prior to running under powershell version 2 it failed every time in the ISE. I have not had the chance to check on another machine yet to verify if the behavior is the same.
-
Now I'm really confused. I jump to powershell 3 non-ise and it runs. Now it no longer errors on my pc in the ise either. We had the error on multiple computers. I'll have to check if the behavior is the same.
-
We only have the issue with New-SwisObject. All the other calls are successful. Get-SwisData, Get-SwisObject, Remove-SwisObject, Set-SwisObject. I posted the trace in the other thread. But at least I now have a workaround using the REST API. It gets past the hurdle where we were unable to script adding nodes to solarwinds.
-
Incorrect, for us New-SwisObject to create Orion.Nodes fails in Powershell_ise 3. However it works in Powershell 2 (non ise). I went to a command prompt, ran powershell -version 2 and the script ran for me and added the node. It throws the error every time I run the script in Powershell_ise 3. I have tried…
-
Thanks, I was able to figure it out. Powershell API was failing for me with New-SwisObject : Object reference not set to an instance of an object. But I was able to put the pieces togther based on your script and what I could find in the pdf. Thanks for your help. new-swisobject fails
-
PS C:\scripts> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 3 0 -1 -1 I haven't had need to try the Invoke-SwisVerb, but all the other calls work for me. New-SwisObject works to add the pollers to the node. It just throws this error on creating nodes in Powershell_ise 3.0 Odd behavior. I…
-
System.NullReferenceException: Object reference not set to an instance of an object. Server stack trace: at SolarWinds.InformationService.Contract2.Serialization.XmlStrippedSerializerCache.GetSerializer(Type type) at SolarWinds.InformationService.Contract2.SerializationHelper.Serialize(Object value, String typename) at…
-
txt2 is missing the $ in the switch statement. Also powershell is a lot like math hierarchy. When I have trouble with a variable inside a string I do this: "some text with $($avariable.aproperty) and some more text."
-
This looks very interesting. Is there a way to learn more about the REST api for solarwinds? Can it be used to add nodes to solarwinds?
-
Powershell_ise 3.0 x86 I know the $swis connection works because I can query/update data. I just cannot add nodes. I've tried it from my Win7 desktop. I've tried it run locally on the solarwinds server. Still this same message: New-SwisObject : Object reference not set to an instance of an object. # This sample script…
-
Is there a way to track when enabling this feature via the SDK may be supported? Many Thanks.
-
It appears to work and return "ok" "ok" Just a couple of powershell pointers here, $lines = @() is an empty array. It's unused in your script above. when you do $B += ... you've created a string. So if you have multiple things you're adding to $B they will be on one line. If you added both to $A or both to $B, the output…
-
Name Value ---- ----- IPAddressGUID 044648a4-0000-0000-0000-000000000000 DynamicIP False MachineType VendorIcon NodeName TDMGER Allow64BitCounters False Community commString RediscoveryInterval 5 SysObjectID PollInterval 120 EngineID 1 ObjectSubType SNMP IPAddress 164.72.70.4 StatCollection 10 UnManaged False Caption…
-
I was able to get the physical drives added properly: $drives = Get-WmiObject -ComputerName hvacn02 -Class win32_Volume -Filter DriveType=3 $drives = $drives | sort DriveLetter foreach ($drive in $drives){ $VolumeDescription = "$($drive.Caption) Label:$($drive.Label) Serial Number $([Convert]::ToString($drive.SerialNumber,…
-
Well at least I found a workaround to script adding nodes to solarwinds. Since the powershell API has been failing for me, I hacked the examples to use JSON/REST to add nodes. ============powershell code================== # Helper function function ip2guid($ipString) { $ip = [System.Net.IPAddress]::Parse($ipString) $src =…
-
can't seem to paste into here. So I've attached the code as a text file.
-
This looks helpful. But I'm also looking for how to set "Asset Inventory". Is that possible via the SDK?