Re: Getting the current Windows user name
From: Greg Burns (greg_burns_at_DONT_SPAM_ME_hotmail.com)
Date: 07/22/04
- Next message: Yuri Vanzine: "VS Designer inadvertently changes control declarations in code-beh"
- Previous message: Chris: "cheating on certs"
- In reply to: Nick: "Re: Getting the current Windows user name"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 17:19:51 -0400
I have the same setup (Win XP Pro for development & Win 2K Server for
deployment) and I only have to give ASPNET user modify permissions to
database folder.
Download Filemon from here:
http://www.sysinternals.com/
Run it on your server, and see what is happening.
Good luck,
Greg
"Nick" <Nick@NTWorks.no.spam.fsnet.co.uk> wrote in message
news:uTVMc9CcEHA.1652@TK2MSFTNGP09.phx.gbl...
> Thanks for the suggestions - that seems to have done the trick!
>
> One difference though - on my XP Pro Dev PC I have to give the ASPNET user
> the database permissions for the pages to work. On the Win2k Server I need
> to give the IWAM_ user the db permissions. Is this right?
>
> Nick
>
> "Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
> news:Oy5u1Q5bEHA.2544@TK2MSFTNGP10.phx.gbl...
> > From a webform inheriting from Page class:
> > Dim sCurrentuser As String = Me.User.Identity.Name
> >
> > From a class not inheriting from Page:
> > Dim sCurrentuser As String = HttpContext.Current.User.Identity.Name
> >
> > Do these:
> > Turn off anonymous access
> > turn on window authentication in IIS
> > web.config autentication mode set to windows
> >
> > Not required to do this
> > Setting Identity Impersonate = True <-- this might be why getting Access
> > denied to Virtual directory on IIS
> >
> > HTH,
> > Greg
> >
> >
> > "Nick" <Nick@NTWorks.no.spam.fsnet.co.uk> wrote in message
> > news:Owsxgn3bEHA.1144@TK2MSFTNGP11.phx.gbl...
> > > I'm developing an intranet app, and want to get the current user name
> for
> > > logging purposes. I've turned off anonymous access, and turned on
> windows
> > > authentication in the IIS config. The apps web.config file has
> > > authentication mode set to windows, and 'identity impersonate' is set
to
> > > true.
> > >
> > > When I try and get the default.aspx page, IE returns an error page
with
> an
> > > 'Access is denied.' error. (Even if I try direct from the webserver,
> > logged
> > > on as the administrator.)
> > >
> > > Where else do I have to set the permissions?
> > >
> > > Thanks,
> > >
> > > Nick
> > >
> > > PS: I'm using this line in the code to get the user:
> > > System.Security.Principal.WindowsIdentity.GetCurrent().Name() - Is
this
> > the
> > > right one to use?
> > >
> > >
> >
> >
>
>
- Next message: Yuri Vanzine: "VS Designer inadvertently changes control declarations in code-beh"
- Previous message: Chris: "cheating on certs"
- In reply to: Nick: "Re: Getting the current Windows user name"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|