Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default validating username and password in Active Directory

I am looking for help with the following task:

1. User clicks button on worksheet
2. Userform opens asking for username and password
3. The username and password information is verified against active directory
4. If username and password match AD, the user's initials are entered into a
particular cell
5. If username and password do not match AD, a msgbox advises the user of
the incorrect information.

I already have the userform created and know how to do the msgbox stuff, I
am just looking for the code to validate the user entered information to that
in AD.

Any suggesetions would be great.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default validating username and password in Active Directory

Does this work for you?

http://www.vbforums.com/showthread.php?t=352349

--JP

On Nov 24, 12:47*pm, josh wrote:
I am looking for help with the following task:

1. User clicks button on worksheet
2. Userform opens asking for username and password
3. The username and password information is verified against active directory
4. If username and password match AD, the user's initials are entered into a
particular cell
5. If username and password do not match AD, a msgbox advises the user of
the incorrect information.

I already have the userform created and know how to do the msgbox stuff, I
am just looking for the code to validate the user entered information to that
in AD.

Any suggesetions would be great.

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default validating username and password in Active Directory

If I copy and paste that code, I get a "Syntax error" at the first line of
the code. Do I need to modify his code to work in VBA? Sorry for the
ignorance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default validating username and password in Active Directory

Yes, you can't set initial values like that in VBA. The default for
Boolean is False anyway. So change

Dim Success As Boolean = False

to

Dim Success As Boolean

--JP

On Nov 25, 7:17*am, josh wrote:
If I copy and paste that code, I get a "Syntax error" at the first line of
the code. *Do I need to modify his code to work in VBA? *Sorry for the
ignorance.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default validating username and password in Active Directory

Thanks. After doing that I also get a syntax error on the next line of code:

Dim Entry As New System.DirectoryServices.DirectoryEntry("LDAP://" & Domain,
Username, Password)

Any ideas?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default validating username and password in Active Directory

Looks like I'm batting .1000. Turns out that code is for .NET, it
won't work in VBA at all.

Sample code:

http://www.freevbcode.com/ShowCode.Asp?ID=710
http://my.advisor.com/doc/08691
http://bytes.com/topic/access/answer...tory-usage-vba

You'll also want to check out the ADSI reference on MSDN (it's a COM
interface for use by non-.NET languages like VBA):

http://msdn.microsoft.com/en-us/libr...70(VS.85).aspx

--JP

On Nov 25, 10:22*am, josh wrote:
Thanks. *After doing that I also get a syntax error on the next line of code:

Dim Entry As New System.DirectoryServices.DirectoryEntry("LDAP://" & Domain,
Username, Password)

Any ideas?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a adcenter username and password Chops Excel Discussion (Misc queries) 0 November 11th 08 11:31 PM
Listing Active Directory groups that have directory access rights [email protected] Excel Programming 0 October 17th 08 03:13 PM
Save active sheet as "filename" on a remote server with username and password Teddy[_3_] Excel Programming 2 May 11th 07 04:48 PM
Password/UserName Gordon[_15_] Excel Programming 1 January 19th 07 09:04 AM
Active Directory and UserName augustus Excel Programming 1 December 21st 04 01:07 AM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"