I’m running the following query to list active network adapters and their associated DNS server settings:
q: concatenation ", " of (addresses of dns servers of adapters whose (address of it as string != "0.0.0.0") of network as string) & ", " & (friendly name of adapters whose (address of it as string != "0.0.0.0") of network as string)
When it runs systems with more than one adapter return the first adapter and then it errors out with “Singular expression refers to non-unique object”. I’m sure it’s something simple, but I’m not seeing where a singular reference is being made.
It’s probably the friendly name of adapters part. If there is more than one adapter, then there will be more than one name and you’d need friendly names of adapters
Since you’re also using & to concatenate together, you’d need to make the multiple names singular again, like you’re doing with the addresses, so something like concatenation ", " of friendly names of adapters
In fact to tie it all together a bit more sensibly, you’d probably separate results for each adapter individually. Something like
(friendly name of it & ": " & concatenation ", " of (it as string) of addresses of dns servers of it ) of adapters whose (address of it as string != "0.0.0.0") of network
Changing it to friendly names of adapters just causes it to only return “A singular expression is required.”. But using
(friendly name of it & ": " & concatenation ", " of (it as string) of addresses of dns servers of it ) of adapters whose (address of it as string != "0.0.0.0") of network
worked like a charm! Thanks so much for looking at this.