Vignesh Posted March 28, 2020 Posted March 28, 2020 Get-NetIPAddress -AddressFamily IPv6 -AddressState Preferred -SuffixOrigin DHCP | Select IPAddress Experts am using above script to fetch IPV6 address information for remote machines it works for some machines but for some machines its throwing the below error upon checking the machine doesn't have DHCP suffix origin ,so here my question is why its throwing below error what does suffixorigin DHCP will do?? its throwing error because ipv6 not enabled?? Error: Below error which we receive most commonly and the IPv6 Address field is Empty Get-NetIPAddress : No matching MSFT_NetIPAddress objects found by CIM query for instances of the ROOT/StandardCimv2/MSFT_NetIPAddress class on the CIM server: SELECT * FROM MSFT_NetIPAddress WHERE ((AddressFamily = 23)) AND ((SuffixOrigin = 3)) AND ((AddressState = 4)). Verify query parameters and retry. At C:\ProgramData\Nexthink\RemoteActions\Scripts\System{2CC0A4D5-9D34-40F9-939D-1EA45AA63609}.ps1:28 char:11 + $ipv6 = ( Get-NetIPAddress -AddressFamily IPv6 -AddressState Preferre ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (MSFT_NetIPAddress:String) [Get-NetIPAddress], CimJobException + FullyQualifiedErrorId : CmdletizationQuery_NotFound,Get-NetIPAddress Unable to write output 'IPV6Address' with given value '' interpreted as System.String: Object reference not set to an instance of an object. Warning: output '' has not been set by script
Moderators JLogan3o13 Posted March 31, 2020 Moderators Posted March 31, 2020 Moved to the most appropriate forum, although @Vignesh I would ask why you're asking a powershell question on an AutoIt forum. 😕 And from the error, it is not returning what you're after, most likely the -AddressFamily. Are you sure every single computer is configured with an IPv6 address? Either way, you should be doing some actual error checking by surrounding your Get-NetIPAddress call in a try/catch block. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Deye Posted April 12, 2020 Posted April 12, 2020 (edited) Vignesh, welcome to the forums Try using my the all new GetTable function I have posted out today @using this command $aArray = GetTable("NetIPAddress -AddressFamily IPv6 -AddressState Preferred") _ArrayDisplay($aArray) And let us know how that works for you Deye Edited April 12, 2020 by Deye
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now