If Exists then do this, or do this

(imported topic written by thesurg3on91)

I’ve a few computers that are in English language and some in Spanish. When I query the local objects I get an error as the object does not exists in the language I was assuming it would be in. I need to write a more complex statement to find if the object exists in English, report the results, if not, report back the results in the secondary language.

example:

members of local group “Administrators”

I need to fancy it up a bit:

if exists local group “Administrators” then members of it else if exists local group “Administradores” then members of it

Needless to say I get quite a few syntax errors, wondering if you can help?

(imported comment written by Lee Wei)

You get the idea and you are almost there.

You can try this statement:

if (exists local group “Administrators”) then (members of local group “Administrators” as string) else (if (exists local group “Administradores”) then (members of local group “Administradores” as string) else (“No admin accounts found”))

(imported comment written by thesurg3on91)

Thanks Lee. After seeing how you wrote it, i think i get the idea how, parenthesis certainly do matter. i appreciate your help. it provides me with the results as expected.