User logged "Full Name"

I need to create a property with the “Full Name” of the user logged into the system.

It’s possible?

System? Win xxxx

Regards

JDELCOL,

What is the use case here? There is the User Name property which pulls

names of logged on users

Are you looking to take this information and query active directory?

Does

names of local users of active directory

give you what you need?

Jared,

There is a predefined property called “User Name”

Q: if exists true whose (if true then exists logged on user else false) then names of logged on users else if exists current user then name of current user else “”
A: jdelcol

I need to this properties, add the “full name”, this could leave the “Active Directory” if possible or I am evaluating the following option, but I am not sure that it works 100%.

Q: values “LastLoggedOnDisplayName” of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" of (if x64 of operating system then (x64 registry;x32 registry) else registry)
A: DEL COL, JUAN CRUZ

If it were with AD, how could I do that query?

I was having issues using

full names

with any of the user relevance, but I did come up with this. Let me know how it works for you.

substring after “CN=” of substrings before “,CN” of (it as string) of (distinguished name of logged on user of active directory)

It came up with a different result for me than your registry check.

Jared, running it with the QNA shows me the following

Q: substring after “CN=” of substrings before “,CN” of (it as string) of (distinguished name of logged on user of active directory)
E: No inspector context.

You will need to go to

Evaluate>Evaluate Using>Local Client

in QnA and then run it again. This actually uses the client you have on your system to evaluate, rather than the QnA engine.

Jared, I have done the following and now I have another error.

Q: substring after “CN=” of substrings before “,CN” of (it as string) of (distinguished name of logged on user of active directory)

E: Singular expression refers to nonexistent object.

What does (distinguished name of logged on user of active directory) yield? It looks like one of the strings isn’t getting matched…I suspect maybe the account is in an OU rather than a CN, or likely a space after the comma in ”, CN="

1 Like

JasonWalker,
It works perfect, but there is a “\” that I need to remove.
How would the command be?

Q: substring after “CN=” of substrings before “,OU” of (it as string) of (distinguished name of logged on user of active directory)
A: DEL COL\, JUAN CRUZ

concatenation of substrings separated by "\" of ...

I should have time to come up with a more generalized query tomorrow, that should work with CN= or OU= …or, more likely, find an existing one at BigFix.me

1 Like

With the first 2 expressions seeming to work, I’m surprised the 3rd returns an error

Q: distinguished names of logged on users of active directory
A: CN=Joe Y Bloggs,CN=Users,DC=example,DC=com
T: 0.061 ms

 
Q: values of components whose (type of it = "CN") of (distinguished names "CN=Joe Y Bloggs,CN=Users,DC=example,DC=com")
A: Joe Y Bloggs
A: Users
T: 0.136 ms

 
Q: values of components whose (type of it = "CN") of (distinguished names of logged on users of active directory)
E: The operator "components" is not defined.

As it turns out,

distinguished names of logged on users of active directory

is a string, not a distinguished name.

So you need to create a distinguished name using the string that results from distinguished names of logged on users of active directory… :slight_smile:

Q: values of components whose (type of it = "CN") of distinguished names (distinguished names of logged on users of active directory)
A: Joe Y Bloggs
A: Users
4 Likes

Nice. So obvious now you say it @itsmpro92

Friends, last week it worked and now it doesn’t work … do you know why it could be?

Q: values of components whose (type of it = “CN”) of distinguished names (distinguished names of logged on users of active directory)
T: 0.000 ms

Perhaps there are really no logged on users, or the machine where you are running Fixlet Debugger is not a member of an Active Directory domain?

YES, the connected user is in the domain.
The test performed is the same as I did last week, with the same user.

Since your result was empty, one of the objects in the multi-part relevance doesn’t exist. What happens if you break down the query into the constituent objects:

Q: logged on users of active directory

Q: distinguished names of logged on users of active directory

Q: values of components of distinguished names (distinguished names of logged on users of active directory

Result:

Q: logged on users of active directory
E: The operator “string” is not defined.

Q: distinguished names of logged on users of active directory
T: 0.000 ms

Q: values of components of distinguished names (distinguished names of logged on users of active directory)
T: 0.000 ms

What inspector context are you using: Local Client or Query Channel using Client?

I’m using “Local Client”