Solved

General Access Denied error while unlocking an Account programmatically

Posted on 2004-08-18
2
1,305 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 83

Accepted Solution

by:
oBdA earned 250 total points
ID: 11835525
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
ID: 11838037
Excellent... Thanks a lot for the same....

Regards,
nganesh.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a guide to the following problem (not exclusive but here) on Windows: Users need our support and we supporters often use global administrative accounts to do this. Using these accounts safely is a real challenge. Any admin who takes se…
No security measures warrant 100% as a "silver bullet". The truth is we also cannot assume anything but a defensive and vigilance posture. Adopt no trust by default and reveal in assumption. Only assume anonymity or invisibility in the reverse. Safe…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

19 Experts available now in Live!

Get 1:1 Help Now