Solved

General Access Denied error while unlocking an Account programmatically

Posted on 2004-08-18
2
1,304 Views
Last Modified: 2013-12-04
Hi,

I use the following code to reset a locked account:

userid = "someUser"
Set objUser = GetObject("WinNT://server/" & userid)
objUser.AccountDisabled = False
objUser.SetInfo
Set objUser = Nothing

But I get the following error when executed while logging as a user with delegated privileges:

Active Directory error '80070005'
General access denied error

I followed the same steps mentioned in the microsoft KB article for delegating permissions:
http://www.microsoft.com/technet/prodtechnol/windows2000serv/howto/delestep.mspx

Is there anything I have missed out?

Please help..

Regards,
nganesh.
0
Comment
Question by:nganesh
2 Comments
 
LVL 82

Accepted Solution

by:
oBdA earned 250 total points
Comment Utility
Yes, you missed to set the proper permissions--which is not really your fault, because the "unlock account" permissions are hidden by default. You can either edit the dssec.dat file to show this in the regular ADUC MMC (which is what I do), or go directly at it with ADSIEdit.

How To Delegate the Unlock Account Right
http://support.microsoft.com/?kbid=294952

HOW TO: Grant a User the Right to Unlock a Locked Account
http://support.microsoft.com/?kbid=312012
0
 
LVL 1

Author Comment

by:nganesh
Comment Utility
Excellent... Thanks a lot for the same....

Regards,
nganesh.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Recently, a new law in my state forced us to get a top-to-bottom analysis of all of our contract client's networks. While we have documentation, it was spotty at best for some - and in any event it needed to be checked against reality. That was m…
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now