473,405 Members | 2,354 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,405 software developers and data experts.

Active Directory: Disable *another* users account

Hi, I am trying to work out how I can disable / enable **another**
users Active Directory account not my own via C#.

If I create a directory entry like so I need to know the other users
password befoew I can do anything with the user. Obviously I will not
know this information

DirectoryEntry de = new DirectoryEntry();
de.Path = "LDAP://192.168.0.1/
CN=Users;DC=DEVELOPMENTDOMAIN";
de.Username = userName;
de.Password = password;

So, can someone please tell me how I can/ if it's possible to disable/
enable another users account via C#?

Thanks
Catherine

Sep 20 '07 #1
2 1811
Hi Catherine,

What you need is, first to seacrh in AD for a specific account according
to its name
(http://www.hagrin.com/255/c_net_how_...tive_directory)
and then change the useraccountcontrol propery
(http://msdn2.microsoft.com/en-us/lib...13(VS.80).aspx)

Hope it help

Cheers

ca*******@myoddjobs.info wrote :
Hi, I am trying to work out how I can disable / enable **another**
users Active Directory account not my own via C#.

If I create a directory entry like so I need to know the other users
password befoew I can do anything with the user. Obviously I will not
know this information

DirectoryEntry de = new DirectoryEntry();
de.Path = "LDAP://192.168.0.1/
CN=Users;DC=DEVELOPMENTDOMAIN";
de.Username = userName;
de.Password = password;

So, can someone please tell me how I can/ if it's possible to disable/
enable another users account via C#?

Thanks
Catherine
Sep 20 '07 #2
Thanks for your help!
On Sep 20, 4:45 pm, Martin CLAVREUIL <m...@w.fwrote:
Hi Catherine,

What you need is, first to seacrh in AD for a specific account according
to its name
(http://www.hagrin.com/255/c_net_how_...unt_active_dir...)
and then change the useraccountcontrol propery
(http://msdn2.microsoft.com/en-us/lib...13(VS.80).aspx)

Hope it help

Cheers

cather...@myoddjobs.info wrote :
Hi, I am trying to work out how I can disable / enable **another**
users Active Directory account not my own via C#.
If I create a directory entry like so I need to know the other users
password befoew I can do anything with the user. Obviously I will not
know this information
DirectoryEntry de = new DirectoryEntry();
de.Path = "LDAP://192.168.0.1/
CN=Users;DC=DEVELOPMENTDOMAIN";
de.Username = userName;
de.Password = password;
So, can someone please tell me how I can/ if it's possible to disable/
enable another users account via C#?
Thanks
Catherine- Hide quoted text -

- Show quoted text -

Sep 20 '07 #3

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

Similar topics

1
by: Amadelle | last post by:
Hi all, I am so desparately in need of some guidance! After two days of struggling I still can't connect to the Active Directory server. I have used so many different ways and so many different...
3
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...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
4
by: pjdouillard | last post by:
Hello all, Here is the context of my problem: We have an ASP.NET 1.1 application that has its own application pool setup and that runs under the identity of a NT Domain service account (this...
0
by: jakobsgaard | last post by:
It is possible to Map a certificate to a Active Directory User Account from DotNet? Please provide an example. Best regards, Ejnar Jakobsgaard...
3
by: Lucky | last post by:
Hi guys, after long long time. i'm back again with another problem. this time i think the problem is very very interesting and i really need you help on this. i'm trying to connect to the...
2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
3
by: Brian McCullough | last post by:
Hello, I am trying to query ADAM using the ActiveDirectoryMembershipProvider in my ASP.NET 2.0 application, but have been unsuccessful. I have followed the steps in these blog posts, but still...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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,...
0
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...

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.