CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

Who do you think you are, anyway?

Sometimes simply knowing who you are can help a great deal.  I just figured out some tricky Active Directory permission issues by tracing out the current WindowsIdentity, like so:

  string strCurrentID = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
  System.Diagnostics.Trace.WriteLine("Current Impersonated Identity: " + strCurrentID );

Anyhow, I kept getting Unknown error (0x80005000).  Problem was, the current user didn't have the proper permissions to our AD store. From an ASP.NET application, this user is: NT AUTHORITY\NETWORK SERVICE.   I changed this to a more trusted account, by changing the anonymous user and password in the “Authentication Methods“ tab in the Directory Security tab of the site properties but I then remembered that I also had to adding the following to my web.config file.

  <identity impersonate="true"/>

Problem solved.

-Brendan

 



Comments

Romualdas said:

And what about simple Page.User property?
# April 28, 2004 8:56 PM

Brendan Tompkins said:

Rom,

Not sure about Page.User, will this show you the current impersonated user? You really need the Windows Identity process in this case.

-B
# April 29, 2004 1:48 AM

graham cotter said:

Alright Lads,

Hopefully ye can help, i am the administrator of a sharepoint site (really i am the documentation guy and i ahve no idea how the hell i got landed with this but...) major problems, some users assigned to a group dont hve to login and others have admin rights. There are alot more issues than this but could ye help with even this..

Graham

ps: i am not a techie but all info will be appricated? grahamcotter@hotmail.com
# October 17, 2004 11:03 PM

Josh Pollard said:

# November 24, 2004 1:03 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!

Our Sponsors

Free Tech Publications