LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Active Directory - Get CommonName from UserName

I can get the UserName (aSAMAccountName or otherwise) on a Windows 7 PC pretty easily (from the environment variables), but I need to get the CommonName so I can do some active directory queires - anyone know how to do this?

I've attached an example that gets the active directory groups of a user - problem is, I can't get the CommonName to input into it (eg: on my domain, my UserName is "christopher_relf" which doesn't work, my CommonName is "christopher relf" which works fine).

 

Cross-posted to LAVA.





Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 1 of 3
(4,562 Views)

Hi Christopher,

 

I think I've figured out what you're getting here. Your VI works on my Windows 7 machine when I enter what I'm assuming is my CommonName (first initial and last name), but doesn't work when I enter what I'm assuming is my UserName (my full name). Just to make sure we're on the same page, I think you're saying that the UserName is what appears in the top right corner of the Windows Start menu, and the CommonName is the name of the folder in C:\Users, along with Default, Admin, etc.

 

Are you just trying to find a way to locate this name at all (i.e. the folder in C:\Users), or do you need to locate it programmatically?

Andy H.
National Instruments
0 Kudos
Message 2 of 3
(4,538 Views)

Thanks for your help Andy, but the question has already been answered on the LAVA thread.





Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 3 of 3
(4,518 Views)