Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to specify credentials for ASP code to run under?

Status
Not open for further replies.

markdmac

MIS
Dec 20, 2003
12,340
US
I am feeling incredibly old. Haven't done any ASP programming in a few years and feel like I've lost a lot of my old skills.

This morning I created a web page that pulls phone numbers from Active Directory and allows them to be updated and the new values written back to Active Directory.

The code works as expected when I access the page using my admin account. It fails when a restricted account is used.

Can someone please remind me how I can set the credentials that the code executes under either via IIS or in the ASP code itself?

Thanks,

Mark
 
Change the user account that the website runs as in the IIS management console.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I got this resolved.

For anyone else looking to do this:

Code:
strUserDN= "LDAP://" & UserLDAP
Const ADS_SECURE_AUTHENTICATION = &H1
Set objRoot = GetObject("LDAP:")              
Set objUser = objRoot.OpenDSObject(strUserDN, szUsername, szPassword, ADS_SECURE_AUTHENTICATION)

I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top