Is Domain Member of XYZ domain

(imported topic written by SystemAdmin)

I’ve done a forum search and couldn’t find anything about this. So what we are trying to do is include some relevance that says is this computer a member of domain xyz. I also searched the inspectors and didn’t find anything.

Does anyone have relevance that does that?

(imported comment written by brolly3391)

Domain membership is exposed in WMI.

q: exists string value whose ( it as lowercase = “xyz”) of selects “Domain from Win32_ComputerSystem” of wmi

I figured this out by looking through this page and I found a property that returns Domain. http://support.bigfix.com/bes/misc/retrievedproperties.html

Then I just played around with it until I got what I wanted.

Cheers,

Brolly

(imported comment written by SystemAdmin)

Brolly,

Thank you!! I must have missed it, because I looked at that page earlier. Thanks Again!

Now, what type of value does that return? I would assume string, but when I try to use string operators they fail. How would one go about using the above code to actually test for membership in a certain domain?

Update:

I think I got it:

exists string value whose (it as lowercase contains “DOMAINNAME”) of selects “Domain from Win32_ComputerSystem” of wmi

Can I tell you I how much I do not like the BES scripting language!!!

(imported comment written by jessewk)

Hi jspanitz,

I don’t think your query will work because you are casting the string value to lowercase and then comparing it to an uppercase value. You’ll need to do this instead (maybe you already are in your production code):

exists string value whose (it as lowercase contains “domainname”) of selects “Domain from Win32_ComputerSystem” of wmi

As far as the Relevance language goes… I agree it was pretty daunting and unusual when I first started. But now with the relevance debugger, the inspector search, the introspectors, and some practice, I find the relevance language the fastest and easiest way to get a lot of my daily tasks done. And I don’t restrict that to simply BigFix tasks… for example I’ll often find that I need to parse a file to extract certain information and I pretty quickly turn to the relevance language over other possible solutions like perl, awk, sed, grep, etc. I hope as you get more familiar with the language and it’s unique quirks you’ll find it’s pretty powerful and useful too.

Jesse

(imported comment written by SystemAdmin)

Jesse,

I actually had the domain name in lowercase in our script, I just uppercased it to make it stand out in the post. Thank you though!

As for the language, I am sure I will get used to it the more I get exposed to it. The problem is, we only occassionally write a custom Task or Fixlet, so any previous knowledge generally leaves my head before I get to use it again!!!

(imported comment written by jessewk)

Yup, certainly helps I “get” to use it everyday