Skip to content

Commit 602bb72

Browse files
authored
Merge pull request #86631 from samueljamkhandi-MSFT/patch-3
Updated document to include PS script to show VM agent status for Lin…
2 parents 1064f84 + efa91dc commit 602bb72

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

articles/virtual-machines/extensions/agent-windows.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,24 @@ The Windows Guest Agent Package is broken into two parts:
3030
To boot a VM you must have the PA installed on the VM, however the WinGA does not need to be installed. At VM deploy time, you can select not to install the WinGA. The following example shows how to select the *provisionVmAgent* option with an Azure Resource Manager template:
3131

3232
```json
33-
"resources": [{
34-
"name": "[parameters('virtualMachineName')]",
35-
"type": "Microsoft.Compute/virtualMachines",
36-
"apiVersion": "2016-04-30-preview",
37-
"location": "[parameters('location')]",
38-
"dependsOn": ["[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"],
39-
"properties": {
40-
"osProfile": {
41-
"computerName": "[parameters('virtualMachineName')]",
42-
"adminUsername": "[parameters('adminUsername')]",
43-
"adminPassword": "[parameters('adminPassword')]",
44-
"windowsConfiguration": {
45-
"provisionVmAgent": "false"
33+
{
34+
"resources": [{
35+
"name": ["parameters('virtualMachineName')"],
36+
"type": "Microsoft.Compute/virtualMachines",
37+
"apiVersion": "2016-04-30-preview",
38+
"location": ["parameters('location')"],
39+
"dependsOn": ["[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"],
40+
"properties": {
41+
"osProfile": {
42+
"computerName": ["parameters('virtualMachineName')"],
43+
"adminUsername": ["parameters('adminUsername')"],
44+
"adminPassword": ["parameters('adminPassword')"],
45+
"windowsConfiguration": {
46+
"provisionVmAgent": "false"
47+
}
48+
}
49+
}
50+
}]
4651
}
4752
```
4853

@@ -89,7 +94,7 @@ OSProfile :
8994
EnableAutomaticUpdates : True
9095
```
9196

92-
The following script can be used to return a concise list of VM names and the state of the VM Agent:
97+
The following script can be used to return a concise list of VM names (running Windows OS) and the state of the VM Agent:
9398

9499
```powershell
95100
$vms = Get-AzVM
@@ -100,6 +105,17 @@ foreach ($vm in $vms) {
100105
}
101106
```
102107

108+
The following script can be used to return a concise list of VM names (running Linux OS) and the state of the VM Agent:
109+
110+
```powershell
111+
$vms = Get-AzVM
112+
113+
foreach ($vm in $vms) {
114+
$agent = $vm | Select -ExpandProperty OSProfile | Select -ExpandProperty Linuxconfiguration | Select ProvisionVMAgent
115+
Write-Host $vm.Name $agent.ProvisionVMAgent
116+
}
117+
```
118+
103119
### Manual Detection
104120

105121
When logged in to a Windows VM, Task Manager can be used to examine running processes. To check for the Azure VM Agent, open Task Manager, click the *Details* tab, and look for a process name **WindowsAzureGuestAgent.exe**. The presence of this process indicates that the VM agent is installed.

0 commit comments

Comments
 (0)