System Variables: Current session
{%SessionType%} : Type (standard, advanced, elevated, role, app, partneradvanced, partnerelevated)
{%SessionName%} : Name (as shown in your recent sessions list)
{%SessionTechnicalName%} : Technical name (to be used with LoadSession: load a sapio365 session )
{%SessionUserName%} : Username (when applicable, username of the connected user)
{%SessionDisplayName%} : User Display Name (when applicable, display name of the connected user)
{%SessionUserID%} : User ID (when applicable, GUID of the connected user)
Detailed Description
Example Script
<Echo value="SessionType = {%SessionType%}"/>
<Echo value="SessionName = {%SessionName%}"/>
<Echo value="SessionTechnicalName = {%SessionTechnicalName%}"/>
<Echo value="SessionUserName = {%SessionUserName%}"/>
<Echo value="SessionUserDisplayName = {%SessionUserDisplayName%}"/>
<Echo value="SessionUserID = {%SessionUserID%}"/>
Standard session:
[01/02/2024 12:45:25 437] SessionType = standard
[01/02/2024 12:45:25 445] SessionName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:45:25 454] SessionTechnicalName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:45:25 464] SessionUserName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:45:25 469] SessionUserDisplayName = Admin MOD
[01/02/2024 12:45:25 476] SessionUserID = 985b709c-6fc2-4775-bc9f-2cd3662c8446
Advanced session:
[01/02/2024 12:42:25 963] SessionType = advanced
[01/02/2024 12:42:25 968] SessionName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:42:25 972] SessionTechnicalName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:42:25 985] SessionUserName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:42:25 989] SessionUserDisplayName = Admin MOD
[01/02/2024 12:42:25 993] SessionUserID = 985b709c-6fc2-4775-bc9f-2cd3662c8446
Elevated session:
[01/02/2024 12:46:16 462] SessionType = elevated
[01/02/2024 12:46:16 465] SessionName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:46:16 470] SessionTechnicalName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:46:16 480] SessionUserName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:46:16 487] SessionUserDisplayName = Admin MOD
[01/02/2024 12:46:16 494] SessionUserID = 985b709c-6fc2-4775-bc9f-2cd3662c8446
Role session:
[01/02/2024 12:42:55 370] SessionType = role
[01/02/2024 12:42:55 375] SessionName = [My Role] AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:42:55 379] SessionTechnicalName = AdminMOD@M365x1234567.onmicrosoft.com|~#~|My Role
[01/02/2024 12:42:55 391] SessionUserName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:42:55 394] SessionUserDisplayName = Admin MOD
[01/02/2024 12:42:55 398] SessionUserID = 985b709c-6fc2-4775-bc9f-2cd3662c8446
App session:
[01/02/2024 13:07:51 897] SessionType = app
[01/02/2024 13:07:51 906] SessionName = My app to test variables!
[01/02/2024 13:07:51 916] SessionTechnicalName = c5b060a3-aae8-4fc7-98d1-991c3b56dea2
[01/02/2024 13:07:51 922] SessionUserName =
[01/02/2024 13:07:51 928] SessionUserDisplayName =
[01/02/2024 13:07:51 932] SessionUserID =
Partner advanced session:
[01/02/2024 12:43:53 391] SessionType = partneradvanced
[01/02/2024 12:43:53 398] SessionName = Customer: YTRIA Test Tenant
[01/02/2024 12:43:53 402] SessionTechnicalName = AdminMOD@M365x1234567.onmicrosoft.com|~$~|d7118fe8-ae41-4766-abfc-5b2a7b886e13
[01/02/2024 12:43:53 411] SessionUserName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:43:53 419] SessionUserDisplayName = Admin MOD
[01/02/2024 12:43:53 423] SessionUserID = 9985b709c-6fc2-4775-bc9f-2cd3662c8446
Partner elevated session:
[01/02/2024 12:49:32 267] SessionType = partnerelevated
[01/02/2024 12:49:32 271] SessionName = Customer: YTRIA Test Tenant
[01/02/2024 12:49:32 275] SessionTechnicalName = AdminMOD@M365x1234567.onmicrosoft.com|~$~|d7118fe8-ae41-4766-abfc-5b2a7b886e13
[01/02/2024 12:49:32 286] SessionUserName = AdminMOD@M365x1234567.onmicrosoft.com
[01/02/2024 12:49:32 291] SessionUserDisplayName = Admin MOD
[01/02/2024 12:49:32 296] SessionUserID = 985b709c-6fc2-4775-bc9f-2cd3662c8446