473,778 Members | 5,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reset Password Right

Hi

I'm trying to apply the "reset password" right to a computer object in Active Directory..
To do this, i used the ActiveDS lib

Whatever i do, i get the 'The security ID is invalid

Here is my little code (in C#)

ActiveDs.IADs dsobject
ActiveDs.IADsSe curityDescripto r sd
ActiveDs.IADsAc cessControlList dacl
ActiveDs.Access ControlEntry NewAce
long lflags
string ComputerPath

ComputerPath="L DAP://"+Domain.ToStri ng()+"/CN="+ComputerNa me.ToString()+" ,OU=Just Created,OU=IT,O U=Bruxelles,OU= Belgium,OU=all computers,DC=do main,DC=com"

dsobject = dsobject.Get(Co mputerPath)

sd = dsobject.Get("n tSecurityDescri ptor")

dacl = sd.Discretionar yAcl

NewAce.AccessMa sk="accessright s"
NewAce.AceType= "accesstype "
NewAce.AceFlags ="aceinheritfla gs"
NewAce.Trustee= UserName.ToStri ng()

dacl.AddAce(New Ace)
sd.Discretionar yAcl = dacl

dsobject.Put("n tSecurityDescri ptor",sd)
dsobject.SetInf o()

I can't figure where's the problem... Is it the approach ? Do i have to use something else ?..

Thanks for reading :

Sneid
Nov 16 '05 #1
1 2115
You need to set the "AccessMask " bit8 (0x100) and the "ObjectType " guid
value 00299570-246d-11d0-a768-00aa006e0529 in the ACE.

Willy.

"Sneid" <sn******@hotma il.com> wrote in message
news:93******** *************** ***********@mic rosoft.com...
Hi,

I'm trying to apply the "reset password" right to a computer object in
Active Directory...
To do this, i used the ActiveDS lib.

Whatever i do, i get the 'The security ID is invalid'

Here is my little code (in C#) :

ActiveDs.IADs dsobject;
ActiveDs.IADsSe curityDescripto r sd;
ActiveDs.IADsAc cessControlList dacl;
ActiveDs.Access ControlEntry NewAce;
long lflags;
string ComputerPath;

ComputerPath="L DAP://"+Domain.ToStri ng()+"/CN="+ComputerNa me.ToString()+" ,OU=Just
Created,OU=IT,O U=Bruxelles,OU= Belgium,OU=all computers,DC=do main,DC=com";

dsobject = dsobject.Get(Co mputerPath);

sd = dsobject.Get("n tSecurityDescri ptor");

dacl = sd.Discretionar yAcl;

NewAce.AccessMa sk="accessright s";
NewAce.AceType= "accesstype ";
NewAce.AceFlags ="aceinheritfla gs";
NewAce.Trustee= UserName.ToStri ng();

dacl.AddAce(New Ace);
sd.Discretionar yAcl = dacl;

dsobject.Put("n tSecurityDescri ptor",sd);
dsobject.SetInf o();

I can't figure where's the problem... Is it the approach ? Do i have to
use something else ?...

Thanks for reading :)

Sneid

Nov 16 '05 #2

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

Similar topics

1
8563
by: Sam | last post by:
I have installed msde 7.0 on a pc with win98. Someone has changed sa password How can I reset sa password? I'm unable to logon with trusted connection because the pc is not nt. Thanks
3
2377
by: Ian | last post by:
Hi I know there are products out there that can do this like http://www.psynch.com/technology/ska.html What is the code that is used to Reset a Users password so the next time they logon to the domain they are promoted for a new password? I know the code will have to run under the Admin. That is fine I just need to know what the API is and how to use it.
0
1255
by: John Gossett | last post by:
I have written an application in vb.net to reset user passwords in active directory. If I run the application as a user with full contol of the AD object I can reset the password. If I run the application as a user with just reset password permission on the account I cannot reset the password and get an error about access denied. At the same time I can run Active Directory Users and Computers and reset the account password. Any...
0
2346
by: serkan | last post by:
Guys, I am trying to get this password reset functionality wor for me but I am not successful at all. Please somebody help me. I get "Your password could not be reset - please try again later" so I think the get_random_word function is not working right. Here are the scripts: This is the script after the user enters his/her userid. <?php require_once("bookmark_fns.php"); // creating short variable name $username = $_POST;
1
1540
by: Dabbler | last post by:
My password reset emails aren't getting through so I have two problems, getting the email to work and resetting the passwords from users who have already missed their reset email. My health emails are getting through which puzzles me. <system.net> <mailSettings> <smtp from="admin@mydomain.com" > <network host="mail.myhost.com" password="mypwd"
12
12870
by: Lile | last post by:
Hello ! I have a problem: I started a new PC, with Windows XP Pro. The first time, it asked me to define the language for region options, language, and keyboard. It offered me corespodentlly : US English (United State) US
4
1480
by: shapper | last post by:
Hello, I placed a textbox in a web page where I ask the user for its email. Now I need to reset its password and get the user profile for the given email if it exists. How can I do this? A side question:
6
9933
by: jarice1978 | last post by:
Hello, I have been scanning the internet for a few days now. That is not working. So now it is time to post! I have read a few other posts on here about authentication but they do not match exactly. We currently have an intranet app built in a mixture of asp and asp.net 1.1 and 2.0 written in VB .Net. We have a form where the user logs in and it authenticates against active directory successully in 2 ways: 1. The admin resets the...
2
13721
by: Homer | last post by:
Hi, I want to be able to reset a user's password and I do not want to use the PasswordRecovery control to reset and email it to the user. A while back, I thought I'd read an article that mentioned about resetting password using the Website Administration Tool. I could not find such option in WSAT. Please help! Thanks, Jon
2
3205
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears out of the text box, but the meter will stay at its current position until text is entered back into the textbox. Once text is re-entered, the meter will display the results again. I would like everything to reset when the button is pushed, but I...
0
9470
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10298
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9923
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
8957
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...
0
6723
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5370
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
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2865
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.