Re: Getting the current Windows user name

From: Greg Burns (greg_burns_at_DONT_SPAM_ME_hotmail.com)
Date: 07/22/04


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?
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: NTBackup - Unable To Restore To XP Hosted Alternate Path
    ... allowed to in share/NTFS permissions. ... The user account used for NTbackup ... Server 2003 users can create authenticate and create directories on the ... remote XT Pro when using a Server 2003 system console. ...
    (microsoft.public.windowsxp.security_admin)
  • ASP.NET bug
    ... First I would like to know how to report problems to MS ... ASPNET user account permissions back in. ... Everytime the server is rebooted you lose the ASPNET user ...
    (microsoft.public.inetserver.iis.security)
  • Re: Access Network Shares from asp.net
    ... the ASPNET user to be identical for the current user of the web server PC. ... > admins" and each user folder inherits that permission, ... > full access permissions for each user based on the folder. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • File Permissions
    ... I recently brought down a w2K server and took the "Files" ... drive out nd installed it into a Windows XP Pro PC. ... can I get permissions to view some of the directories? ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Server 2002 admin projects
    ... project and non-working time with Pro 2003 and Server ... I can see a section in server where you can set you non- ... >> I do not have sufficient permissions. ...
    (microsoft.public.project.pro_and_server)