Security issue with DirectoryServices

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Security issue with DirectoryServices

    In an attempt to programmatically create a website using
    Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create", "IIsWebServer",
    intSiteID), DirectoryEntry))

    ....

    site.Invoke("SetInfo")

    works fine until the SetInfo is called.

    It produces an "Access denied" from source "mscorlib". I am sure this as
    been address here previously but can someone who has resolved this kindly
    repost the fix/workaround.

    Thanks


    Carl Guest

  2. Similar Questions and Discussions

    1. Odd security issue
      We have set-up our HR dept. with Contribute to manage their Intranet content. In doing so, I created a security group on the server and applied it...
    2. Is this a security issue
      While trying to signon at a website, I got the following PHP code back. I suppose that their apache was mistakenly returning php text instead of...
    3. Similar issue with .NET Security
      Hello; having similar ASP.NET security issues. Upgrading a number of ASP classic apps to .NET and haveeverything done but cant figure out how to...
    4. Major ASP.Net Security Issue?
      I have found what I believe to be a serious security issue in ASP.Net. If you have: 1. Your website configured for anonymous access 2. Elect...
    5. New security issue
      New security update will not download on my Computer (HP....Windows XP). Message states that I need to see if Cryptographic is in my computer....
  3. #2

    Default Re: Security issue with DirectoryServices

    Are you modifying IIS on the local machine or a remote machine? Is the
    current thread executing with an account with administrator rights?

    Joe K.

    "Carl" <rushrush@verizon.net> wrote in message
    news:urkRvHmOFHA.1476@TK2MSFTNGP09.phx.gbl...
    > In an attempt to programmatically create a website using
    > Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create",
    > "IIsWebServer",
    > intSiteID), DirectoryEntry))
    >
    > ...
    >
    > site.Invoke("SetInfo")
    >
    > works fine until the SetInfo is called.
    >
    > It produces an "Access denied" from source "mscorlib". I am sure this as
    > been address here previously but can someone who has resolved this kindly
    > repost the fix/workaround.
    >
    > Thanks
    >
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #3

    Default Re: Security issue with DirectoryServices

    The ASP.NET pages are running on the local machine. I am using the machine's
    administartor/password for site.username/site.password as:

    Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create", "IIsWebServer",
    intSiteID), DirectoryEntry))
    site.Username = "Administrator"
    site.Password = "xxyyzz1234"


    "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
    in message news:umcAVHtOFHA.164@TK2MSFTNGP12.phx.gbl...
    > Are you modifying IIS on the local machine or a remote machine? Is the
    > current thread executing with an account with administrator rights?
    >
    > Joe K.
    >
    > "Carl" <rushrush@verizon.net> wrote in message
    > news:urkRvHmOFHA.1476@TK2MSFTNGP09.phx.gbl...
    > > In an attempt to programmatically create a website using
    > > Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create",
    > > "IIsWebServer",
    > > intSiteID), DirectoryEntry))
    > >
    > > ...
    > >
    > > site.Invoke("SetInfo")
    > >
    > > works fine until the SetInfo is called.
    > >
    > > It produces an "Access denied" from source "mscorlib". I am sure this as
    > > been address here previously but can someone who has resolved this
    kindly
    > > repost the fix/workaround.
    > >
    > > Thanks
    > >
    > >
    >
    >

    Carl Guest

  5. #4

    Default Re: Security issue with DirectoryServices

    Ah, the IIS provider ignores passed in credentials. I really wish MS would
    document this more clearly as it trips up a lot of people!

    It only works with the security context of the current thread
    (System.Security.Principal.WindowsIdentity.GetCurr ent().Name). So, you need
    to make sure that is set to the administrator account you need.

    Typically you do that with either impersonation to change the thread
    identity or by changing the worker process identity.

    Joe K.

    "Carl" <rushrush@verizon.net> wrote in message
    news:%23zlxuyGPFHA.524@TK2MSFTNGP09.phx.gbl...
    > The ASP.NET pages are running on the local machine. I am using the
    > machine's
    > administartor/password for site.username/site.password as:
    >
    > Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create",
    > "IIsWebServer",
    > intSiteID), DirectoryEntry))
    > site.Username = "Administrator"
    > site.Password = "xxyyzz1234"
    >
    >
    > "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
    > in message news:umcAVHtOFHA.164@TK2MSFTNGP12.phx.gbl...
    >> Are you modifying IIS on the local machine or a remote machine? Is the
    >> current thread executing with an account with administrator rights?
    >>
    >> Joe K.
    >>
    >> "Carl" <rushrush@verizon.net> wrote in message
    >> news:urkRvHmOFHA.1476@TK2MSFTNGP09.phx.gbl...
    >> > In an attempt to programmatically create a website using
    >> > Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create",
    >> > "IIsWebServer",
    >> > intSiteID), DirectoryEntry))
    >> >
    >> > ...
    >> >
    >> > site.Invoke("SetInfo")
    >> >
    >> > works fine until the SetInfo is called.
    >> >
    >> > It produces an "Access denied" from source "mscorlib". I am sure this
    >> > as
    >> > been address here previously but can someone who has resolved this
    > kindly
    >> > repost the fix/workaround.
    >> >
    >> > Thanks
    >> >
    >> >
    >>
    >>
    >
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  6. #5

    Default Re: Security issue with DirectoryServices

    Many thanks Joe!

    For those that need further information, I found this.
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod15.asp[/url]



    "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
    in message news:#H3IXaHPFHA.2252@TK2MSFTNGP15.phx.gbl...
    > Ah, the IIS provider ignores passed in credentials. I really wish MS
    would
    > document this more clearly as it trips up a lot of people!
    >
    > It only works with the security context of the current thread
    > (System.Security.Principal.WindowsIdentity.GetCurr ent().Name). So, you
    need
    > to make sure that is set to the administrator account you need.
    >
    > Typically you do that with either impersonation to change the thread
    > identity or by changing the worker process identity.
    >
    > Joe K.
    >
    > "Carl" <rushrush@verizon.net> wrote in message
    > news:%23zlxuyGPFHA.524@TK2MSFTNGP09.phx.gbl...
    > > The ASP.NET pages are running on the local machine. I am using the
    > > machine's
    > > administartor/password for site.username/site.password as:
    > >
    > > Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create",
    > > "IIsWebServer",
    > > intSiteID), DirectoryEntry))
    > > site.Username = "Administrator"
    > > site.Password = "xxyyzz1234"
    > >
    > >
    > > "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com>
    wrote
    > > in message news:umcAVHtOFHA.164@TK2MSFTNGP12.phx.gbl...
    > >> Are you modifying IIS on the local machine or a remote machine? Is the
    > >> current thread executing with an account with administrator rights?
    > >>
    > >> Joe K.
    > >>
    > >> "Carl" <rushrush@verizon.net> wrote in message
    > >> news:urkRvHmOFHA.1476@TK2MSFTNGP09.phx.gbl...
    > >> > In an attempt to programmatically create a website using
    > >> > Dim site As New DirectoryEntry(CType(objIIs.Invoke("Create",
    > >> > "IIsWebServer",
    > >> > intSiteID), DirectoryEntry))
    > >> >
    > >> > ...
    > >> >
    > >> > site.Invoke("SetInfo")
    > >> >
    > >> > works fine until the SetInfo is called.
    > >> >
    > >> > It produces an "Access denied" from source "mscorlib". I am sure this
    > >> > as
    > >> > been address here previously but can someone who has resolved this
    > > kindly
    > >> > repost the fix/workaround.
    > >> >
    > >> > Thanks
    > >> >
    > >> >
    > >>
    > >>
    > >
    > >
    >
    >

    Carl Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139