473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ADSI - Trying to enable a user - the user add works very well

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
jl******@systemfix.ca
Nov 23 '05 #1
0 1514

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Miguel Orrego | last post by:
Hi, I have found some code that authenticates users agains a domain using ADSI. I then redirect to another page and pass the username they have entered as a string. However, it would be nice to...
4
by: Akhlaq Khan | last post by:
we are developing an intranet application (web based) which needs to detect the logged in user ID of the user hitting the website. the intranet is huge and based on win2k active directory (around...
2
by: Christopher Johannsen | last post by:
Good Day: I am working on building a tool Using ASP/COM & IIS5.1 for a non-administrative technical support team to change domain passwords for users. I have the basic interface built and...
14
by: Arran Pearce | last post by:
Hi, I am looking for a way to use System.DirectoryServices to find all users on a domain whos accounts are either locked out or disabled. I have used ADSIEdit and the mmc schema add-in to try...
5
by: Rubble | last post by:
Hello, Im trying to see if a user exists in active directory. The code I have has been posted elsewhere and apparantly works for others....but it will not work for me. I get the error: "The...
8
by: msnews.microsoft.com | last post by:
I have ADSI code that I can make work at the command line. I cannot in any way get it to work in asp.net. Even using Windows authentication, impersonation on, and providing the credentials...
1
by: James Schuler | last post by:
I am trying to run a query in an ASP.NET application against Active Directory using a linked server (ADSI) in SQL Server 2000. The query runs without any problems in Query Analyzer: SELECT...
1
by: Jeremie Legault | last post by:
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...
3
by: TomikZ | last post by:
I'd like to get some user account properties using .asp script. When I try to use ADSI WINNT provider it works fine except that I apparently cannot access some properties such as...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.