473,395 Members | 1,473 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,395 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 2087
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.