List administrator group account problem

(imported topic written by bearandy)

I create a analysis to list computer administrator group accounts:

elements of intersection of (set of ((following text of last “” of it) of (members of local group “Administrators” as string)))

And most computers show the administrator accounts, but some computers show “Singular expression refers to nonexistent object”.

I don’t know why. Any suggestion?

(imported comment written by Lee Wei)

If the name does not contain a “”, then you will get the error.

Try this statement

(following text of last 
"\" of it | it) of (members of local groups "Administrators
" as string)

The “|” is an OR operator. Note that it only works in TEM Agents 8.0 and greater.

Your set operator is not necessary in this case. You have a set of Strings and you are taking the intersect of that one set, which is superfluous.

(imported comment written by bearandy)

Thanks it seems work.

I want to ask if we could change the permission of user account to administrator temporarily.

And then change back the permission.

Could it is possible?

(imported comment written by SystemAdmin)

This thread found useful for me. However i was going through some more threads which provides similer info.

I’d a concern while going through above thread and bit stuck to change it accoriding to my requriement.

My Requirement:-

Identify and remove the members of group “Administrators” whose a part of Domain user group.

I tried to parse the below expression but landing up with some otehr error.

concatenations ", " of (members whose (it = “Match1” or it = “match2”) of local group “Administrators” as string)

Here I want match the starting letter of the ID, when i tried the same i got below result.

Q: concatenations ", " of (members whose (it starts with “7” or it starts with “3”) of local group “Administrators” as string)

E: The operator “starts with” is not defined.

Can some one help me here…

(imported comment written by SystemAdmin)

Dear Lee… thanks for the post, however I was trying to perform few more customizations, after trying your query i got below result

Q: (following text of last “” of it | it) of (members of local groups “Administrators” as string)

A: officer

A: Domain Admins

A: HelpDesk Global

A: 800020558

T: 133.923 ms

However out of these members whose part of Administrator’s group i need to display only IDs which starts from the numbers “8” or “7” or “3”.

in this case i want to show only “800020558” in result section as this ID is part of AD

is their any way to find it out

(imported comment written by SystemAdmin)

Can some one please help me here…

(imported comment written by SystemAdmin)

Off the top of my head, try something like this …

(following text of last 
"\" of it | it) of (members of local groups "Administrators
" as string) whose (set of ("7
") contains (first 1 of it as lowercase))