LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use active directory to validate users?

I'd like to use LabVIEW and Active Directory to validate users and access levels of those users in the application. Any ideas?
0 Kudos
Message 1 of 19
(9,726 Views)
What is your lv version?
0 Kudos
Message 2 of 19
(9,724 Views)

I'm using LabVIEW 8.6.1 and soon to be using 2009.

 

We are using Windows Server 2003 but are migrating to Windows Server 2008.

 

 

0 Kudos
Message 3 of 19
(9,710 Views)
Did you try a search? The easiest solution is to use .NET. A VI was posted in this thread.
Message 4 of 19
(9,686 Views)

That thread was very useful. It got me started on the right path. I simply modified the "Directory Entry" constructor node to 'DirectoryEntry(String path, String username, String password) and it validates the username and password.

 

Next up is getting 'memberof' to work. The example code listed no groups for me, yet I know I am a member of several groups. I am not familiar at all with .NET, so this is very awkward for me. I did read something that stated I could be a member of a group but if the attribute isn't set (don't know what that means) then it wouldn't report the group name.

 

I'll keep digging.

0 Kudos
Message 5 of 19
(9,672 Views)

Got it! The issue turned out to be a mix of things.

 

First, the name I was entering into the 'Filter' property in the 'DirectorySearcher' property node didn't match the CN name defined in Active Directory. However, it did match the name of a computer! That is why I wasn't getting an 'member of' results - the computer isn't a member of any groups.Smiley Wink

 

Next, the sAMAccountName is different than the CN name configured in Active Directory. So instead of filtering on 'CN=' I had to use 'SAMAccountName='.

 

From there, the results from the 'path' property in the 'SearchResult' property node had the correct 'CN' name, OU, and DCs to pull group names.

 

Maybe this is obvious to some, but I had to learn:

  1. Make sure you have the correct LDAP attribute and name combination
  2. Beware of computers and user accounts being named the same
  3. Watch out for differences between CNs and SAMAccountNames 

For more info on LDAP Attributes, see this.

 

Message Edited by dkentner on 08-26-2009 06:23 AM
Message 6 of 19
(9,649 Views)

Can you post what you found?  I am trying to do the same thing, but don't see where to get a output from the 'DirectoryEntry(String path, String username, String password) constructor.  I was expecting the properties to include something such as IsAuthenticated, but I'm stumped.

0 Kudos
Message 7 of 19
(9,287 Views)

Hi kipk12,

 

this is quite old, but new for me.

 

I tried it out this way, just like dkentner described it...see the attachment!

 

And for your question for a "IsAuthenticated" reply: Just try it with a wrong combination of user and password...and you will get an "Exception". But I'm with you, a separate "answer" would be nice!

 

Another thing: Is there a place where all these things are documented, e.g. the "memberOf" property?

 

Regards

A:T:R

Message 8 of 19
(9,070 Views)

Hi A:T:R,

 

Here's a website that provides a good explanation of the memberOf attribute: http://www.rlmueller.net/MemberOf.htm.

 

Regards,

Allison M.
Applications Engineer
National Instruments
ni.com/support
0 Kudos
Message 9 of 19
(9,043 Views)

Hi, I have LV2010. Can you plz downconvert the code and send it again.

 

Many Thanks.

Regards

Sreedhar

0 Kudos
Message 10 of 19
(8,968 Views)