all groups > asp.net > april 2004 >
You're in the

asp.net

group:

Impersonation woes


Impersonation woes Alvin Bruney [MVP]
4/30/2004 11:40:14 PM
asp.net:
From a webpage, I am calling a com object which needs to read a file. It
keeps throwing access denied errors. I am stumped. I think I have tried
everything I know what to do. The webpage can read the file. Just fine. The
com object can't.

Create user group.
Impersonate user.
User has full rights to directory
added everyone - full rights. no joy
added admin - full rights no joy
message box tells me that the page is executing under that user. no joy
full rights to every user group i can find on the system. no joy
ditch impersonation, admin rights to everybody. no joy
message box tells me that the page is executing under network services
give network services full rights. no joy
share folder no joy
create web sharing apply permissions no joy
the com object can read the system and event logs without problem
the com object can read the log file if fired from a dos prompt on the
server

why me lowd. why me?????

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok

Re: Impersonation woes Alvin Bruney [MVP]
5/1/2004 9:52:37 AM
[quoted text, click to view]
Yes. No joy.

Out of curiosity - I wonder
[quoted text, click to view]
This also fails with an access denied.

Microsoft also doesn't support the com object (logparser) so i won't even be
able to open a support ticket.

This is the call that blows:

MSUtil.LogQueryClassClass log = new LogQueryClassClass();
MSUtil.ILogRecordset records = log.Execute(@"select cs-uri-stem from
C:\WINDOWS\system32\LogFiles\W3SVC230775414\ex030515.log group by
cs-uri-stem", null);

The com object is logparser available with win2k and up or at logparser.com.
This call will work without a problem on my machine. But not on the server.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
[quoted text, click to view]

Re: Impersonation woes John Timney (Microsoft MVP)
5/1/2004 2:06:37 PM
Alvin,

have you tried upping your asp rights in machine config.

Try setting the process model username to system
userName="SYSTEM"

Sounds to me like your com object is expecting to find a window of some type
to enable it to run, and cant find a window. Out of curiosity - I wonder
what would happen if you use process.start cmd/com thing from asp.net rather
than trying to invoke com from within asp.net

Regards

John Timney
Microsoft Regional Director
Microsoft MVP

[quoted text, click to view]

Re: Impersonation woes John Timney (Microsoft MVP)
5/1/2004 8:09:42 PM
Sounds like your stuck.

I've worked round this type of impossible thing to do in web srever world
before by having a socket listener running on the desktop and actually
invoking windowed type things via that - implies you have a logged in user
on your server which is kind of hacky but it requires no permissions or
impersonation and bypasses the web restrictions.

You might be able to find out who write it at MS if you drop a line into the
pivate groups.

Regards

John Timney
Microsoft Regional Director
Microsoft MVP

[quoted text, click to view]

Re: Impersonation woes Alvin Bruney [MVP]
5/2/2004 10:13:44 AM
John,
look at my eyes. can you tell i have been up all night?

your socket idea gave me a clue so i impersonated to an authenticated user
on the machine and boom. candy....

Apparently, asp.net only allows authenticated users to do that kind of
thing - makes sense too.

thanks for everything

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
[quoted text, click to view]

Re: Impersonation woes John Timney (Microsoft MVP)
5/2/2004 11:46:18 PM
A result ............... hooray!!!

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP


[quoted text, click to view]

AddThis Social Bookmark Button