You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** The second key (under \Policies) is necessary only if the relevant Group Policy setting is configured. The value will be rewritten at next Group Policy refresh if it's configured in Group Policy.
52
+
**Note:** The second key (under \Policies) is necessary only if the relevant Group Policy setting is configured. The value will be rewritten at next Group Policy refresh if it's configured in Group Policy.
53
53
54
54
## Use CMD to manage Windows services
55
55
56
56
To manage Windows services by using CMD, follow these steps:
The second key (under \Policies) would only be needed if the relevant group policy setting had been configured. Value will be rewritten at next group policy refresh if it's configured in group policy.
386
+
The second key (under \Policies) would be needed only if the relevant group policy setting had been configured. Value will be rewritten at next group policy refresh if it's configured in group policy.
`Get-NetAdapter` is available on 2012+. For 2008R2 use `Get-WmiObject`. Azure VMs should always be configured in the guest OS to use DHCP to obtain an IP address. The Azure static IP setting still uses DHCP to give the IP to the VM.
452
+
`Get-NetAdapter` is available in 2012 and later versions. For 2008 R2, use `Get-WmiObject`. Azure VMs should always be configured in the guest OS to use DHCP to obtain an IP address. The Azure static IP setting still uses DHCP to give the IP to the VM.
453
453
454
454
### Ping
455
455
456
456
`test-netconnection`
457
457
458
458
> [!NOTE]
459
-
> The Write-Progress cmdlet may not work with this command. As a mitigation, you can run `$ProgressPreference = "SilentlyContinue"` in PowerShell to disable the progress bar.
459
+
> The Write-Progress cmdlet might not work by using this command. As a mitigation, you can run `$ProgressPreference = "SilentlyContinue"` in PowerShell to disable the progress bar.
`Test-Netconnection` without any parameters try to ping `internetbeacon.msedge.net`. It's available on 2012+. For 2008R2 use `Get-WmiObject` as in the second example.
465
+
`Test-Netconnection` without any parameters, try to ping `internetbeacon.msedge.net`. It's available in 2012 and later versions. For 2008 R2, use `Get-WmiObject`, as in the second example.
`Set-NetFirewallProfile` is available on 2012+. For 2008R2 use `netsh advfirewall` as referenced in the CMD section above.
505
+
`Set-NetFirewallProfile` is available in 2012 and later versions. For 2008 R2, use `netsh advfirewall` as referenced in the CMD section above.
506
506
507
507
## Manage Users and Groups using PowerShell
508
508
@@ -518,7 +518,7 @@ or
518
518
519
519
`(get-wmiobject Win32_UserAccount -Namespace "root\cimv2" -Filter "SID like 'S-1-5-%-500'").Disabled`
520
520
521
-
`Get-LocalUser` is available on 2012+. For 2008R2 use `Get-WmiObject`. This example shows the built-in local administrator account, which always has SID `S-1-5-21-*-500`. Azure VMs created from generalized image will have the local administrator account renamed to the name specified during VM provisioning. So it will usually not be `Administrator`.
521
+
`Get-LocalUser` is available in 2012 and later versions. For 2008 R2, use `Get-WmiObject`. This example shows the built-in local administrator account, which always has SID `S-1-5-21-*-500`. Azure VMs created from generalized image will have the local administrator account renamed to the name specified during VM provisioning. So it will usually not be `Administrator`.
`Get-LocalUser` is available on 2012+. For 2008R2 use `Get-WmiObject`. This example shows the built-in local administrator account, which always has SID `S-1-5-21-*-500`.
541
+
`Get-LocalUser` is available in 2012 and later versions. For 2008 R2, use `Get-WmiObject`. This example shows the built-in local administrator account, which always has SID `S-1-5-21-*-500`.
`Get-LocalUser` is available on 2012+. For 2008R2 use `Get-WmiObject`.
547
+
`Get-LocalUser` is available in 2012 and later versions. For 2008 R2, use `Get-WmiObject`.
548
548
549
549
## Manage the Windows Event Log using PowerShell
550
550
@@ -596,7 +596,7 @@ This example returns the file version of the virtual NIC driver, which is named
596
596
597
597
This example creates a `c:\bin` folder, then downloads and extracts the Sysinternals suite of tools into `c:\bin`.
598
598
599
-
## Miscellaneous Tasks using PowerShell
599
+
## Miscellaneous tasks that use PowerShell
600
600
601
601
### Show OS version
602
602
@@ -626,7 +626,7 @@ Adding `-force` forces running applications to close without warning users.
626
626
627
627
You can query Azure instance metadata from within your Azure VM to view details such as osType, Location, vmSize, vmId, name, resourceGroupName, subscriptionId, privateIpAddress, and publicIpAddress.
628
628
629
-
Querying instance metadata requires healthy guest network connectivity, because it makes a REST call through the Azure host to the instance metadata service. So if you're able to query instance metadata that tells you the guest is able to communicate over the network to an Azure-hosted service.
629
+
Querying instance metadata requires healthy guest network connectivity because it makes a REST call through the Azure host to the instance metadata service. If you're able to query instance metadata, that means that the guest can communicate over the network to an Azure-hosted service.
630
630
631
631
For more information, see [Azure Instance Metadata service](/azure/virtual-machines/windows/instance-metadata-service).
0 commit comments