How to check the GUID of the current logged in user at the moment of the call inside a workflow. RRS feed

All replies

  • Hi Moiz,


    Try to use this code:

    var user = Membership.GetUser( HttpContext.Current.User.Identity.Name );



    Miguel Soler
    Monday, November 28, 2011 11:15 PM
  • Got exception: 'System.Web.HttpContext.Current' is null


    Tuesday, November 29, 2011 5:31 AM
  • Hi again,


    With WindowsIdentity.GetCurrent().Name you will get the user that is managing the workflow, but since the worklfow runs under the context of system account , you get sharepoint/system as the current user. However, with in ontaskchanged event of your workflow, you have a parameter called ExternalDataEventargs e, the user who is actually modifying the task is given by e.identity.



    Miguel Soler
    Tuesday, November 29, 2011 8:25 AM