Cómo exportar listado de todos los Amazon Workspaces y obtener su última conexión.

1. Creación del Rol IAM de la instancia bastión.

2. Asignación del Rol a la instancia Windows EC2

3. Conectamos a la instancia Bastión RDP

Get-WKSWorkspace | ForEach-Object { $connstat = Get-WKSWorkspacesConnectionStatus -WorkspaceId $_.WorkspaceId  New-Object PSObject -Property @{              WorkspaceId = $_.WorkspaceId; User = $_.UserName; ComputerName = $_.ComputerName; DirectoryId = $_.DirectoryId; IpAddress = $_.IpAddress; State = $_.State; SubnetId  = $_.SubnetId; ConnectionState = $connstat.ConnectionState; LastConnection = $connstat.LastKnownUserConnectionTimestamp; ConnectionStateCheckTimestamp = $connstat.ConnectionStateCheckTimestamp  }  } | Export-Csv outputtesttest.csv –NoTypeInformation

Conclusiones

  • inventario total de todos los Workspaces con su respectiva IP Privada.
  • El usuario que tiene asignado cada WorkSpaces.
  • El último Login realizado al Workspace.
  • El Workspaces ID , Usuario asignado e Ip privada.

--

--

Entrepreneur, travel lover, AWS x3, CIO High Cloud Tec , AWS Community Builder, passionate about cloud learning

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Oscar Ivan Ocampo

Oscar Ivan Ocampo

35 Followers

Entrepreneur, travel lover, AWS x3, CIO High Cloud Tec , AWS Community Builder, passionate about cloud learning