473,320 Members | 1,945 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,320 software developers and data experts.

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.IADsSecurityDescriptor sd
ActiveDs.IADsAccessControlList dacl
ActiveDs.AccessControlEntry NewAce
long lflags
string ComputerPath

ComputerPath="LDAP://"+Domain.ToString()+"/CN="+ComputerName.ToString()+",OU=Just Created,OU=IT,OU=Bruxelles,OU=Belgium,OU=all computers,DC=domain,DC=com"

dsobject = dsobject.Get(ComputerPath)

sd = dsobject.Get("ntSecurityDescriptor")

dacl = sd.DiscretionaryAcl

NewAce.AccessMask="accessrights"
NewAce.AceType="accesstype"
NewAce.AceFlags="aceinheritflags"
NewAce.Trustee=UserName.ToString()

dacl.AddAce(NewAce)
sd.DiscretionaryAcl = dacl

dsobject.Put("ntSecurityDescriptor",sd)
dsobject.SetInfo()

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 1039
You need to set the "AccessMask" bit8 (0x100) and the "ObjectType" guid
value 00299570-246d-11d0-a768-00aa006e0529 in the ACE.

Willy.

"Sneid" <sn******@hotmail.com> wrote in message
news:93**********************************@microsof t.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.IADsSecurityDescriptor sd;
ActiveDs.IADsAccessControlList dacl;
ActiveDs.AccessControlEntry NewAce;
long lflags;
string ComputerPath;

ComputerPath="LDAP://"+Domain.ToString()+"/CN="+ComputerName.ToString()+",OU=Just
Created,OU=IT,OU=Bruxelles,OU=Belgium,OU=all computers,DC=domain,DC=com";

dsobject = dsobject.Get(ComputerPath);

sd = dsobject.Get("ntSecurityDescriptor");

dacl = sd.DiscretionaryAcl;

NewAce.AccessMask="accessrights";
NewAce.AceType="accesstype";
NewAce.AceFlags="aceinheritflags";
NewAce.Trustee=UserName.ToString();

dacl.AddAce(NewAce);
sd.DiscretionaryAcl = dacl;

dsobject.Put("ntSecurityDescriptor",sd);
dsobject.SetInfo();

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
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
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...
0
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...
0
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...
1
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...
12
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 :...
4
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? ...
6
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...
2
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...
2
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.