473,586 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Directo ryServices) 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(ByV al sender As Object, ByVal e As EventArgs)
Dim objUsers As ActiveDs.IADsCo ntainer
Dim objNewUser As ActiveDs.IADsUs er
objUsers = GetObject("LDAP ://OU=Pickupfootba ll,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( "displayNam e", txtFName.Text & "." & txtLName.Text)
objNewUser.Put( "descriptio n", GNDList.Text & ";" & txtAge.Text)
objNewUser.SetI nfo()
objNewUser.Chan gePassword("", "j1r1mi1")

End Sub
Thanks
Jeremie Legault
jl******@system fix.ca
Nov 23 '05 #1
0 1519

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

Similar topics

6
4418
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 also get their full name from Active Directory once authenticated. Can anyone suggest how I may modify this code to achieve this? I would also like...
4
7366
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 20-30 different domains) with 25K+ users. i dont want to use "NT challenge response" for this pupose. I am exploring ways using ADSI and WMI to...
2
4076
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 working from my developement machine (Windows XP Pro SP 1A) which is hosting the pages for now. The problem is that when I try to access the site from a...
14
5207
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 and find properties for these things but have not had any luck so far. Also i did a search on the Platform SDK doc's. It has examples in VB and C++...
5
2637
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 specified domain either does not exist or could not be contacted." Can anyone please help me? Im completely lost here. Here is the code (roughly the...
8
1784
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 hardcoded, I cannot make this same code happen. This is all I am trying to do: static void Stuff() { //we don't need the credentials on this form // so...
1
2767
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 sAMAccountName FROM OPENQUERY ( ADSI,
1
2344
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 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...
3
5863
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 objUser.managedObjects. I have this simple code: <% Set objUser = GetObject("LDAP://CN=Users,CN=FisrtName LastName,DC=MyDomain,DC=com") For Each strValue in...
0
8204
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3838
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.