MeshCentral icon indicating copy to clipboard operation
MeshCentral copied to clipboard

Show Userprincipalname (UPN) instead of NT Style username

Open JohanvanZanten opened this issue 1 month ago • 2 comments

I noticed that the MeshCentral agent reports the old NT4.0 domain style username back (domain\username), in a windows domain you have both the UPN and Old style, and they can differ

In Microsoft Office 365 / AzureAD only the UPN is synchronized and is the unique identifier, it would make sense to show that in MeshCentral on the General Tab as Active User too

the UPN is more modern opposed to the OLD NT 4.0 style

Describe the solution you'd like make it possible to show either the old NT4.0 style or the UPN style active user

Describe alternatives you've considered I considered to have the UPN as Agent tag but that would make ik a bit more static

Additional context Add any other context or screenshots about the feature request here.

Image

JohanvanZanten avatar Nov 04 '25 07:11 JohanvanZanten

can you share a drawing/screenshot of what you are after? (strange request i no haha)

si458 avatar Nov 11 '25 15:11 si458

Image

instead of VAN-ZANTEN\ANTON the UserPrincipalName in the email format [email protected] (the last part is redacted), in the user column

Image as wel or without the domain.tld part

this the output of whois on a windows device:

Image

JohanvanZanten avatar Nov 11 '25 15:11 JohanvanZanten

im just looking into this again, are the computers domain joined or azure joined or mix? i can get the Win32_ComputerSystem from wmi which shows if its PartOfDomain and also its Domain in my case FTH\simonsmith is the user and based of win32 i can get it to show [email protected] but my comps are in domains, and from what i can see azure joined computers show BLANK domains?

si458 avatar Dec 20 '25 18:12 si458

hmm ok so i eventually managed to my vm to link to my free entra ad, when you sign in with my test account (as a works computer), the user shows as AzureAD\SimonSmith yet the email address is totally different! also the computers domain is registered as WORKGROUP too, so not sure how to get the UPN then?

si458 avatar Dec 20 '25 22:12 si458

in other (powershell) scripts I use the whoami utility with the /upn switch which tells me the correct logged on UPN (so the command line would be whoami /upn that tells me [email protected])

JohanvanZanten avatar Dec 21 '25 08:12 JohanvanZanten

@JohanvanZanten yes the problem you have is because the service runs as local system so running whoami returns the system user not the local user! And our powershell stuff to run as a user, opens a black window on the users desktop when we run stuff as that user So that isnt ideal! Now i think i found away around! Im doing some experimenting and will reply back if i need some testing off u :) Also how did u want the UPN shown? Did u want the UPN shown instead of the domain\fth Or are u happy if u hover over the domain\fth it shows the upn?l

si458 avatar Dec 21 '25 09:12 si458

Man, do you sleep at all? ;) I noticed the behaviour when running as the agent, regarding the shown type: either have a selection option to switch between upn / old NT style or hovering would be great ;)

JohanvanZanten avatar Dec 21 '25 10:12 JohanvanZanten

@si458 can you shed more light on that way / work around ?

JohanvanZanten avatar Dec 22 '25 07:12 JohanvanZanten

@JohanvanZanten sadly my work around didnt work, I was checking the wrong value! More testing/debugging :)

si458 avatar Dec 22 '25 10:12 si458