Skip to content

Instantly share code, notes, and snippets.

@mlapida
Created January 1, 2015 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mlapida/87614982f5a6e4ad205e to your computer and use it in GitHub Desktop.
Save mlapida/87614982f5a6e4ad205e to your computer and use it in GitHub Desktop.
Azure: Check VM Agent Health
param (
# Define Parameters
[parameter(Mandatory=$true)]
[string]$sub,
[parameter(Mandatory=$true)]
[string]$vm,
[parameter(Mandatory=$true)]
[string]$service
)
Select-AzureSubscription -SubscriptionName $sub
#Check the communication status of the Agent
(Get-AzureVM -ServiceName $service -Name $vm).GuestAgentStatus | Format-List GuestAgentVersion,Status
#Update Agent config to allow connections
Get-AzureVM -ServiceName $service -Name $sub | Set-AzureVMAccessExtension | Update-AzureVM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment