none
Getting the FILE owner/creator information from BizTalk RRS feed

  • Question

  • Is there a way I can get the file owner/creator information from a received message in BizTalk? 

    Friday, January 16, 2015 2:14 PM

Answers

  • Yes, you can get it from the FileSecurity object through the File object in a custom Pipeline Component.

    However, like many file properties, this is not reliable in many circumstances as it's value depends entirely on how the file was handled.

    A copy/move through a Windows API will probably retain the original owner, FTP will not.

    • Proposed as answer by Angie Xu Thursday, January 22, 2015 1:59 AM
    • Marked as answer by Angie Xu Friday, January 23, 2015 1:45 AM
    Friday, January 16, 2015 2:30 PM
    Moderator

All replies

  • From BizTalk’s point of view file creator is the source folder location/source system. Since you have mentioned it as “File”, I assume you deal with adapter like File or FTP so ReceivedFileName context property of the received  message can get you the source folder location.

    ReceivedFileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

    If you’re referring the physical file creator name –No is not possible.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Friday, January 16, 2015 2:20 PM
  • Thanks for your reply. Yes I am referring the physical file creator/owner of the file, and yes I am using the FILE adapter. Is this impossible to achieve even from a custom pipeline component or a custom adapter?
    Friday, January 16, 2015 2:25 PM
  • Yes, you can get it from the FileSecurity object through the File object in a custom Pipeline Component.

    However, like many file properties, this is not reliable in many circumstances as it's value depends entirely on how the file was handled.

    A copy/move through a Windows API will probably retain the original owner, FTP will not.

    • Proposed as answer by Angie Xu Thursday, January 22, 2015 1:59 AM
    • Marked as answer by Angie Xu Friday, January 23, 2015 1:45 AM
    Friday, January 16, 2015 2:30 PM
    Moderator
  • Try the following in the custom pipeline, which I have NOT tried personally. I would refrain doing, but give it a go, if it fits you:

    string sReceivedFileName = pInMsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
    string sCreatorName = System.IO.File.GetAccessControl("sReceivedFileName").GetOwner(typeof(System.Security.Principal.NTAccount)).ToString()


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Friday, January 16, 2015 2:32 PM
  • Hi,

    you cannot get this information in BizTalk, it is not possible to answer your question.


    Mark As Answer or Vote As Helpful if this helps.

    Friday, January 16, 2015 2:36 PM
  • I do suggest its not full proof to have file owner/creator  information populated from Biz Talk end .

    As these operation are out of Biz Talk Environmental scope ,I wont say any code can be able to give your these information accurately  .

    Thanks

    Abhishek

    Friday, January 16, 2015 2:52 PM