Debugging Workflow : Identify current user

Hello -

I’m testing kenaflow Free Edition.

In my sample workflow I want to identify the current user that executes the workflow. I mean the windows login name.

I need this for debug to execute different things when I debug the workflow script. Later the workflow runs with a different account.

if( MyUser ) {
   # do some debug stuff
}

thx
Anne

Hi Anne,

thank you for testing kenaflow! :slight_smile:

You can use

[System.Security.Principal.WindowsIdentity]::GetCurrent().Name

to get the current user.

https://msdn.microsoft.com/en-us/library/sfs49sw0(v=vs.110).aspx

Additionally you can use Get-KFInDebug to get the debug state of the current workflow script:
https://doc.kenaflow.com/en/cmdlets/cmdlets/get-kfindebug

Ingo

Thank you. That’s it.