I currently am trying to get nslookup information.
I use the nslookup to find cisco umbrella information
nslookup -q=txt debug.opendns.com | select-string -Pattern "device"
My output shows as
Non-authoritative answer:
"device 0xxxxyyyyyzzzzze"
but it is truly only outputting device 0xxxxyyyyyzzzzze
, which is great.
However, is there a way to parse this information further so that it will only show the "0xxxxyyyyyzzzzze" part? The number letter sequence is always different. I would like this get this information into an MDM as custom variable so I can do remediation on devices without it.
Tried
nslookup -q=txt debug.opendns.com | select-string -Pattern "device" -Exclude "device"
Wasn't sure if this can' be done for text on the same line. Trying to not sure the word "device" but show the rest of the text.
Here is a better regex than the one in my comment, with this one there is no need to trim the last double-quote
"
from the string:See https://regex101.com/r/gdL46B/1 for details.