BizTalk Host Instance ID in an expression shape

Home Page Forums BizTalk 2004 – BizTalk 2010 BizTalk Host Instance ID in an expression shape

Viewing 1 reply thread
  • Author
    Posts
    • #17834

      I am a newvbie and have searched for this without luck.  Does anyone know how I can get the Account ID associated with the Host Instance that my orchestration is running under?  I would like to access it in the Expression shape and log it.

      Thanks for any help.

      Tina

    • #17847

      You could simply try using the WindowsIdentity class in System.Security.Principal:

      WindowsIdentity MyIdentity = WindowsIdentity.GetCurrent();
      string name = MyIdentity.Name;

       

      • #17848

        Couldn't this produce different results.  We have various Host Instances running under differing credentials.  I need to get the credentials under which my Orchestration is running.  Is there no BTS object that can return this information?

        Thanks – Tina

        • #17852

          That code would return exactly the user your orchestration is running under at that precise moment. If your orchestration later dehydrates and is moved to a separate server, then sure, it could rehydrate again and be running in a different host instance and a different account. Don't see what the problem with that is.

           The simple fact is, theres no such thing as "the credentials under which the orchestration is running". Orchestrations don't have credentials attached to them, so at best what you can ask for is which credentials the host instance it is currently executing on has associated.
           

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.