Property for both Windows and Linux Domain

Hi Guys,

I am trying to create a single property to find the domain of both Linux and Windows systems in my environment but for some reason am getting undefined for the LINUX servers.

Below is the relevance I’m using:

if (exists wmi) then (string values of selects “Domain from Win32_ComputerSystem” of wmi) else if not exists file “/etc/resolv.conf” then “” else if not exists line starting with “domain” of file “/etc/resolv.conf” then “” else first match (regex “[^\ ]+”) of following text of first “domain” of line starting with “domain” of file “/etc/resolv.conf”

Any help would be appreciated.

Thanks

You need to test for windows before testing for wmi - otherwise you have a linux machine trying to run a test for which it has no inspector and you get your result.

Hey Trn - Thanks for you input. I was able to resolve the issue with the below relevance:

if name of operating system as lowercase contains “win” then (string values of selects “Domain from Win32_ComputerSystem” of wmi) else if not exists file “/etc/resolv.conf” then “” else if not exists line starting with “search” of file “/etc/resolv.conf” then “” else first match (regex “[^\ ]+”) of following text of first “search” of line starting with “search” of file “/etc/resolv.conf”