PC Review


Reply
Thread Tools Rate Thread

ADSI - Active DS Type Library - Trying to enable a user and it doe

 
 
=?Utf-8?B?SmVyZW1pZSBMZWdhdWx0?=
Guest
Posts: n/a
 
      23rd Nov 2005
Hi,

I have written an ASP.NET 2.0 application that uses Active Directory or ADAM
to manage account users - the site has a page that allows people to create an
account (much like any site). The page populates the AD with all the
information and the user account but I am unable to enable the account.
Microsoft has information on how to do that here -->
http://msdn.microsoft.com/library/de...ing_a_user.asp
(the sample is for Visual Basic) - and I am unable to complete the bottom
portion of the script. Can some one point me in the right direction - or can
you tell me how I can add a snippet of VBscript code to an ASP.NET page.

I am using the Active DS Type library - not sure why there are multiple ones
(System.DirectoryServices) but it is rather confusing - I seem to accomplish
one thing with one and another with the other (they did have trouble
co-existing however). Anyway my script works very well but I am not able to
access the properties required to enable the account.

Here is a simple version (no error checking) of the code
Sub BTSub_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim objUsers As ActiveDs.IADsContainer
Dim objNewUser As ActiveDs.IADsUser
objUsers = GetObject("LDAP://OU=Pickupfootball,DC=systemfix,DC=ca")
objNewUser = objUsers.Create("user", "CN=" & txtFName.Text &
txtLName.Text)
objNewUser.Put("sAMAccountName", txtFName.Text & txtLName.Text)
objNewUser.Put("givenName", txtFName.Text)
objNewUser.Put("sn", txtLName.Text)
objNewUser.Put("streetAddress", txtEADDR.Text)
objNewUser.Put("mail", txtEADDR.Text)
objNewUser.Put("title", txtOCC.Text)
objNewUser.Put("displayName", txtFName.Text & "." & txtLName.Text)
objNewUser.Put("description", GNDList.Text & ";" & txtAge.Text)
objNewUser.SetInfo()
objNewUser.ChangePassword("", "j1r1mi1")

End Sub
Thanks
Jeremie Legault
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADSI - Trying to enable a User after it is added (User addition wo =?Utf-8?B?SmVyZW1pZSBMZWdhdWx0?= Microsoft Dot NET 1 24th Nov 2005 01:41 AM
Check programmatically User or Computer is connected to a Active Directory using ADSI or LDAP Manu Microsoft Windows 2000 Active Directory 1 10th Sep 2005 03:57 PM
enable a user account in Active Directory? Angelo Microsoft C# .NET 1 8th Mar 2005 04:12 PM
Using ADSI and LDAP to retrieve user attributes from active direct =?Utf-8?B?bllzc2E=?= Microsoft Outlook Form Programming 1 6th Dec 2004 04:23 AM
Disable/enable user in ADSI =?Utf-8?B?QWxlYm9yZw==?= Microsoft C# .NET 17 30th Mar 2004 11:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:12 AM.