Results 1 to 22 of 22

Thread: what file ??? permissions huh ???

  1. #1

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492

    what file ??? permissions huh ???

    Trying to send Outlook tasks from asp/vb.net web app and I have this:

    VB Code:
    1. Imports Microsoft.Office.Interop.Outlook
    2. Public Class WebForm1
    3.     Inherits System.Web.UI.Page
    4.  
    5. #Region " Web Form Designer Generated Code "
    6.  
    7.     'This call is required by the Web Form Designer.
    8.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    9.  
    10.     End Sub
    11.     Protected WithEvents Button1 As System.Web.UI.WebControls.Button
    12.  
    13.     'NOTE: The following placeholder declaration is required by the Web Form Designer.
    14.     'Do not delete or move it.
    15.     Private designerPlaceholderDeclaration As System.Object
    16.  
    17.     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    18.         'CODEGEN: This method call is required by the Web Form Designer
    19.         'Do not modify it using the code editor.
    20.         InitializeComponent()
    21.     End Sub
    22.  
    23. #End Region
    24.  
    25.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    26.         'Put user code to initialize the page here
    27.     End Sub
    28.  
    29.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    30.         Dim objOutlook As Microsoft.Office.Interop.Outlook.Application
    31.         Dim objTask As TaskItem
    32.         objOutlook = New Microsoft.Office.Interop.Outlook.Application
    33.         objTask = objOutlook.CreateItem(OlItemType.olTaskItem)
    34.         objTask.Recipients.Add("ssmith")
    35.         objTask.Subject = "Test"
    36.         objTask.Body = "This is the body"
    37.         objTask.Assign()
    38.         objTask.Send()
    39.  
    40.     End Sub
    41. End Class

    But right when i say objOutlook = New....

    I get an error:

    Code:
    Exception Details: System.UnauthorizedAccessException: Access is denied. 
    
    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 
    
    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
    I tried everything...What the hell is this error. What file????!?!?!?
    I tried to go to the reference itself:
    C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb
    I right clicked and added every frigging user in our company ...still no luck...gave them write permissions and everytihng...

    I need to get this to work so badly please guys help!!!!

    Just need to send outlook tasks from asp.net/vb.net to a user.

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Did you add the (machinename)\ASPNET account? or the (machinename)\Network Service account?

    You said you added every user in the company, but did you add those?

    The reason this is happening is that the ASP.NET worker process has VERY limited permissions on what it can do. You have to specifically let the asp.net worker process access untrusted resources on the network. So, in this case it is trying to access some COM components that are not a trusted resource that ASP.NET can access.

  3. #3

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by hellswraith
    Did you add the (machinename)\ASPNET account? or the (machinename)\Network Service account?

    You said you added every user in the company, but did you add those?

    The reason this is happening is that the ASP.NET worker process has VERY limited permissions on what it can do. You have to specifically let the asp.net worker process access untrusted resources on the network. So, in this case it is trying to access some COM components that are not a trusted resource that ASP.NET can access.
    Hmm if I am local on my machine on an xp box i dont have that ASPNET user...

    Should I just do this on the windows server?

    have you done anytihng like this before hell?

    That sounded weird :-).

    If you have created tasks or anything from ASP.net can you please give me some direction. I will talk to admins tomorrow to do what you have stated.

    Thanks again man

    Jon

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by jhermiz
    Hmm if I am local on my machine on an xp box i dont have that ASPNET user...
    What about NETWORK SERVICE?

  5. #5

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by mendhak
    What about NETWORK SERVICE?
    Where what how ?????

  6. #6

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by mendhak
    What about NETWORK SERVICE?
    Locally on my machine I added that NETWORK SERVICES and gave it FULL permissions

    I still get:

    Access is denied.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccessException: Access is denied.

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by jhermiz
    Locally on my machine I added that NETWORK SERVICES and gave it FULL permissions

    I still get:

    Access is denied.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccessException: Access is denied.

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
    The message is displaying exactly what you need to do:
    {MACHINE}\ASPNET
    or
    IUSR_MACHINENAME

    If you are on Windows XP Pro, there is a ASPNET account that is local to the machine. This is the one you need to let access it. Don't confuse it with the domain accounts, those are completely different. So if your machine name was MyComputer, then you need to add MyComputer\ASPNET as an authorized to execute.

  8. #8

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by hellswraith
    The message is displaying exactly what you need to do:
    {MACHINE}\ASPNET
    or
    IUSR_MACHINENAME

    If you are on Windows XP Pro, there is a ASPNET account that is local to the machine. This is the one you need to let access it. Don't confuse it with the domain accounts, those are completely different. So if your machine name was MyComputer, then you need to add MyComputer\ASPNET as an authorized to execute.
    Hells....

    As I said I have done this over and over....
    I still get this error.

    Here to prove it first off I right clicked that app (shared folder inside inetpub wwwroot).
    Went to the sharing tab here is what it has:



    Ok it has THOSE accounts...

    Then I went to the security tab...please look....



    Im just trying to do this locally first....

    I get that SAME error I posted before...

    Ive posted my code...all it is is a simple TASK...this works in VB.net alone but DOES NOT work in ASP.net (even though the code behind is inside VB.net.

    Can anyone please help!

  9. #9

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Anyone ?

    Has anyone done this ?

    No responses from anyone anywhere, I just cannot believe no one has EVER had to integrate outlook with ASP.net ???

    Come on folks please im begging right now!

  10. #10
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    But did you add the aspnet account access to this folder:
    C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb

    or anything else that that olb accesses?

  11. #11
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by jhermiz
    Ive posted my code...all it is is a simple TASK...this works in VB.net alone but DOES NOT work in ASP.net (even though the code behind is inside VB.net.

    Can anyone please help!
    The reason it works in a windows forms app is because you are running that windows forms app as the logged in user, which is you. You have permission to access all the files. When you do this from ASP.NET, the user isn't you, it is ASPNET that is trying to do the work. The ASPNET account doesn't have all the permissions you have. There is a lot to this that you are just trying to skirt around. You really have to learn this stuff in order to be effective.

  12. #12

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by hellswraith
    The reason it works in a windows forms app is because you are running that windows forms app as the logged in user, which is you. You have permission to access all the files. When you do this from ASP.NET, the user isn't you, it is ASPNET that is trying to do the work. The ASPNET account doesn't have all the permissions you have. There is a lot to this that you are just trying to skirt around. You really have to learn this stuff in order to be effective.
    Learn this stuff ?????

    Im not trying to praise myself but I write solid code ...
    and BARELY anyone in the asp.net forums can even understand what I usually am looking for. I dont think there is a single forum that has answers to any asp problems. Most people just guess, it is RIDICULIOUS...sorry for the complaining but just look at this thread no one can give a GOOD solid answer. Everything is "did you check this" " i dunno try this"...

    It may not be any ones fault...I just dont think that .net at least via asp.net is straightforward, in fact this whole gosh darn frame work is a piece of sh**

  13. #13

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by hellswraith
    But did you add the aspnet account access to this folder:
    C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb

    or anything else that that olb accesses?
    Yes I gave WRITE / READ / EXECUTE every gosh damn permission to that file too...I still get the Access is denied error.

    Doesnt anyone have a frigging step by step way to do this...

    So frustrating...

    Anyone else with ideas ?

    Hells thanks for being patient with me.

  14. #14

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    hells,

    Is the rest of my code right ?
    Am I approaching this right ?
    Do you have a sample you can post and tell
    me exactly what you did? I just need to send tasks
    from asp.net (outlook tasks). I've exhausted myself
    through google, yahoo, MSDN, God knows where else...

    Im trying to get this to work and it's just irritating me!

  15. #15
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  16. #16
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Im not trying to praise myself but I write solid code ...
    and BARELY anyone in the asp.net forums can even understand what I usually am looking for. I dont think there is a single forum that has answers to any asp problems. Most people just guess, it is RIDICULIOUS...sorry for the complaining but just look at this thread no one can give a GOOD solid answer. Everything is "did you check this" " i dunno try this"...
    They are providing suggestions in where you can look to try & track down the problem & are still helping even if no-one but you has come across this error.

    I used the following solution when I had this issue with Microsoft Word & Excel.

    1) Goto the windows start menu & enter dcomcnfg.
    2) At the applications tab, & double click on the "Microsoft word document" to enter this selection's properties.
    3) Set the authentication level to connect on the 1st tab.
    4) Set each of the permissions under the security tab to include access for the above-mentioned accounts.
    5) Set the Tools>macro>macro security inside of the application to low.

    Now I noticed that whilst in this applications list under the dcomcnfg tool that there was no specific "microsoft outlook mail" entry, so this is another "try" suggestion.

    There are 2 listed appliactions which start with "Outlook" under this list which I would set the permissions of. If this doesn't help, then I would go under the default properties & default security tabs of the dcomcnfg tool & set these to allow access as a test. As this allows these user accounts access to run more-or-less any application on your computer, I would make a note of the current settings so you can change this back at a later date.

    Let me know if just the later suggestion fixed your probelm & I can look into which individual outlook application you should need to set.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  17. #17
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    As a side note, it was unclear how you were destroying your outlook object, but make sure you use the following code to completely destroy the reference:
    VB Code:
    1. objOutlookApp.quit
    2. System.Runtime.InteropServices.Marshal.ReleaseComObject(objOutlookApp)
    3. objOutlookApp = nothing

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  18. #18

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Alex,

    What tabs are you talking about ????

    When I type in what you stated I get component services, with absolutely NO tabs. I see component services, event viewer, and
    services (local). SO where you are getting this I dont see...

    Jon

  19. #19

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    I looked at the security alerts in Component Services.

    For the event viewer under security I see this:

    Event Type: Error
    Event Source: DCOM
    Event Category: None
    Event ID: 10003
    Date: 10/17/2004
    Time: 12:21:01 AM
    User: EARTH\ASPNET
    Computer: EARTH
    Description:
    Access denied attempting to launch a DCOM Server using DefaultLaunchPermssion. The server is:
    {0006F03A-0000-0000-C000-000000000046}
    The user is ASPNET/EARTH, SID=S-1-5-21-1645522239-602609370-839522115-1007.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


    Ok...So what does this mean...and how do I fix this ???

  20. #20
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    So, is the computer you are running the app on called 'EARTH'?

    If so, then why isn't the EARTH\ASPNET account given permissions to that object?

    In the images you shown below, you show the D900176\ASPNET account, but not the EARTH\ASPNET one? Is this your problem?


    The last thing I can offer you is to map your ASPNET account to use a real user account on your network. Certain things like exchange won't work unless they are being used by a Active Directory user. The local ASPNET account to the machine it is running on usually isn't part of Active Directory.

    When I tell you that you need to learn this stuff, I am not attacking your code at all. I am attacking your knowledge of network security and how the ASPNET user is mapped and used on the local machine and box. I don't really care how solid your code is, if the network won't allow a process to do something, you are stopped right there. You need to figure out the permissions to allow it to do it.

    As far as no one here knowing the exact steps...come on, you are acting a little childish. We are trying to help you in any way we can. We may have never done exactly what you are doing, but we have done similar things. I have no more advice to offer you, so good luck.

  21. #21
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You never replied on this...did you ever get it fixed? If so, I would like to know what it was so that if anyone else ever has this problem I can pass off the answer to them.

  22. #22

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Originally posted by hellswraith
    You never replied on this...did you ever get it fixed? If so, I would like to know what it was so that if anyone else ever has this problem I can pass off the answer to them.
    I scraped that entire idea, waste of time on it...besides its a web based application and the task needed to be sent on the client side.

    I decided to come up with a better solution. Writing an active x control in vb6 (COM) and dropping it on the web page. That way I could use VBScript or JScript to call the object and it would run on the client side .

    Currently cleaning up the code but it works a treat and its over the web...and guess what I CAN SEND TASKS IN ASP.NET :-)

    Jon

Posting Permissions

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



Click Here to Expand Forum to Full Width