Search code examples
azurepowershellazure-automation

Get the last seen time for Azure Hybrid worker group


I'm trying to retrieve the last seen time value for hybrid worker groups using PowerShell. However, I cannot find any of the parameters of "Get-AzureRMAutomationHybridWorkerGroup" or the members of this Cmdlet that can retrieve this value. I can see that I can only retrieve the registration time. Any advice?


Solution

  • finally I got it working by importing the latest Version 0.6.1 from the Az.Automation module. the same is true for the "old" commandlet with prefix AzureRM and Version 6.13.1: https://www.powershellgallery.com/packages/AzureRM/6.13.1

    The missing property thing was already fixed in September (https://github.com/Azure/azure-powershell/commit/e098199011c3ad09ef94a0b70f6de76f61bddd12#diff-f3a5751aabbc428aaa014a0c847c2e61)

    enter image description here

    PS /home/Falco> Get-Module
    
    ModuleType Version    Name                                ExportedCommands
    ---------- -------    ----                                ----------------
    Script     0.6.1      Az.Automation                       {Export-AzAutomationDscConfiguration, Export-AzAutomationDscNodeReportContent, Export-AzAutomationRunbook, Get-AzAutomationAccount...}
    Script     0.6.1      Az.Profile                          {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...}
    

    Version 0.5.0 was installed before and had the issue with missing date.

    this will give you the desired result.

    PS /home/Falco> (Get-AzAutomationHybridWorkerGroup -ResourceGroupName RG1 -AutomationAccountName Automationtest).RunbookWorker | fl
    
    
    IpAddress        : 192.168.1.7,172.17.192.1,172.18.201.17
    Name             : Server
    RegistrationTime : 11/18/18 11:55:52 PM +00:00
    LastSeenDateTime : 11/22/18 1:25:23 AM +00:00