Azure Automation: WHO AM I

Azure Automation is gaining lot of popularity and it is quite a black box. You author a runbook, publish it and run it. Do you know on which machine the runbook is getting executed and the name of the user account used to execute the runbook?

The answer is that we can figure out!!

You can author a runbook in Azure automation as shown below and execute it. It is output the name of the local machine as well as the user under which the runbook is getting executed.


workflow Whoami
{
inlinescript{
$WindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent()

$WindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($WindowsID)

$WindowsPrincipal.Identity

}
}

This would print the details about the identity under which the runbook was executing as well as the host or computer name. The result or output would look like below.


IsAnonymous : False
Name : LsaSetupDomain\Administrator
Owner : S-1-5-21-3235083057-2096672557-690217298-500
User : S-1-5-21-3235083057-2096672557-690217298-500
Groups : {S-1-5-21-3235083057-2096672557-690217298-513, S-1-1-0, S-1-5-114, S-1-5-32-544...}
Token : 1012
Claims : {}
Actor :
BootstrapContext :
Label :
NameClaimType : http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
RoleClaimType : http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid

The entire thing would like below

AA identity

Note the name shown in yellow. It is LsaSetupDomain\Admninistraor.

Hope you enjoyed this post!

Cheers!

Advertisements

Powershell cmdlets for Azure Automation now available!!

The latest Powershell version for Azure has added 43 new cmdlets to manage Azure Automation.

After downloading the latest version of Azure Powershell check the build number containing these cmdlets. It should be 0.8.14.

You get the version number of Azure module by executing the following command.aa0

You can also execute the below command to get all the available cmdlets belonging to Azure Automation.

aa1

The cmdlets primarily belongs to Azure Automation Assets like Connection, Credential, Variables, and Schedules. It also has cmdlets for managing Accounts and Runbooks.

We will deep-dive into each of these cmdlets and Azure Automation to know how they work.

Stay tuned!!

Cheers to Azure Automation !!