473,698 Members | 2,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing Active Directory user information via ASP.NET

Hi,

i've written some code that changes the user information (eg givenname, sn,
department, ...) from a user in AD. The code runs without an error/exception.
The only annoying thing is that the changes aren't executed. here is my code :
Dim deEntry As New DirectoryEntry
deEntry.Path = "LDAP://myDomainControl ler"

Dim dsSearch As New DirectorySearch er(deEntry)
dsSearch.Filter = "(&(objectClass =user)(samaccou ntname=" & strLogin
& "*))"
Dim entry As DirectoryEntry = dsSearch.FindOn e.GetDirectoryE ntry
With entry
.Properties("sn ").Value = nieuweMdw.achte rnaam
.Properties("gi venname").Value = nieuweMdw.voorn aam
.Properties("de partment").Valu e = nieuweMdw.afdel ing
.Properties("ti tle").Value = nieuweMdw.funct ie
.Properties("co mpany").Value = nieuweMdw.firma
.Properties("ma il").Value = nieuweMdw.email
.Properties("te lephonenumber") .Value = nieuweMdw.telnr
End With
entry.Authentic ationType = AuthenticationT ypes.Secure
entry.CommitCha nges()
entry.RefreshCa che()
entry.Close()

does anyone see my problem? Thx!
Nov 9 '05 #1
1 1486
>i've written some code that changes the user information (eg givenname, sn,
department, ...) from a user in AD. The code runs without an error/exception.
The only annoying thing is that the changes aren't executed. here is my code :
does anyone see my problem? Thx!


One word: permissions.

In a web environment, you almost HAVE to bind to the root of your AD
directory search with explicit credentials - otherwise you don't have
permissions to update your AD. Also, in many cases, you would need to
specify the actual domain controller to bind to in order to get
results.

So something like this (this is C# - transforms easily into VB.NET):

DirectoryEntry deRootDSE = new DirectoryEntry( "LDAP://RootDSE");
string sRootDN =
deRootDSE.Prope rties["defaultNamingC ontext"].Value.ToString ();

DirectoryEntry deSearchRoot = new
DirectoryEntry( "LDAP://myDC01.mydomain .com/" + sRootDN, "your user
name here", "your password", AuthenticationT ypes.Secure);

DirectorySearch er dsSearch = new DirectorySearch er(deSearchRoot );

If that doesn't help - you might want to post to
microsoft.publi c.adsi.general - that's where all the AD programming
gurus hang out (tons of them with much more VB.NET and web experience
than myself).

Marc

Nov 9 '05 #2

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

Similar topics

7
8519
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way of doing it. I have a table with products, tblProducts, some of them are Active while others are Inactive. The form shows all the products purchased by a customer, both Active and Inactive in a ComboBox, cbProducts. My client wants to view all...
6
2411
by: Leo_Surf | last post by:
Hello, I need your help adding user in Active Directory from ASP.net website. Could any one provide me the complete code for the html page. As this is my curriculam project and I dont have any Idea about ASP.net Please Help Thanks in Advance.
3
3475
by: Luis Esteban Valencia | last post by:
Hello gusys, Is it possible to make my asp.net application add users to the AD , I also want to be able to delete users, modify their information, everything through a website. Thanks for the info
3
2651
by: Adrian Parker | last post by:
At the moment, we have a simple user id / password entry screen to login to our website, the data credentials are held in our database. We've now been asked to integrate with active directory so that users on the lan who are already logged in via active directory no longer need to log into the website, but automatically are logged in using their network userid (which should match the old website login). I can see how I could prompt for...
10
4055
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to Pop up windows Authentication box so that user will give his userId, Password & domain name for authenticaion. After that I want to take these three info of user and make a search in Active Directory.
2
8128
by: Alpha | last post by:
I need to retrieve and set information in Active Directory in a new project that I'll be working on. I went to Amazon.com to look for a good book on this subject but found books on this subject all using C++. Can I make ADSI and LDAP API calls using C#? Can someone recommend a good book for this subject with C# as sample code? Thanks, Alpha
0
5410
by: Chung Leong | last post by:
In this brief tutorial I'll describe how you retrieve information from an Active Directory through the OLE-DB extension. While it is possible to use the LDAP extension to achieve the same goal, as you will see using Microsoft's OLE-DB provider is much easier. You will need to download and install the OLE-DB extension. Here's the location once again: http://sourceforge.net/project/showfiles.php?group_id=171247&package_id=198554. See my...
7
2777
by: Vio | last post by:
Hello everyone, i currently a beginner in php. I want to ask about Win2003 Active Directory users. Is it possible to retrieve Win2003 AD (just username & password) with php. I'm currenty developing web based application for my small office. I put my Apache+php+MySQL in Win2003 Server. My Clients using IE as default browser. What i want to do is to integrated active directory user with my application.
0
1450
by: lairpr74 | last post by:
Hi, I got a console application that updates active directory users, the information to be updated in active directory comes from a database table. This is my problem: right now the application works if none of the objects like (telephoneNumber, department, etc..) to be updated into active directory are not null. If an object is null I get an error. I try with an if condition, it does not give any error but does not updates the object...
0
9029
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8870
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3051
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.