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
Copy file name to clipboardExpand all lines: support/azure/virtual-machines/windows/serial-console-cmd-ps-commands.md
+43-41Lines changed: 43 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,109 +15,111 @@ ms.author: jarrettr
15
15
ms.custom: sap:VM Admin - Windows (Guest OS)
16
16
---
17
17
18
-
# Windows Commands - CMD and PowerShell
18
+
# How to use CMD and PowerShell Windows commands
19
19
20
20
**Applies to:**:heavy_check_mark: Windows VMs
21
21
22
-
This section includes example commands for performing common tasks in scenarios where you may need to use SAC to access your Windows VM, such as when you need to troubleshoot RDP connection failures.
22
+
This article provides example commands to perform common tasks in scenarios in which you have to use the Special Administration Console (SAC) to access your Windows virtual machine (VM). For example, you might have to use SAC to troubleshoot RDP connection failures.
23
23
24
-
SAC has been included in all versions of Windows since Windows Server 2003 but is disabled by default. SAC relies on the `sacdrv.sys` kernel driver, the `Special Administration Console Helper` service (`sacsvr`), and the `sacsess.exe` process. For more information, see [Emergency Management Services Tools and Settings](/previous-versions/windows/it-pro/windows-server-2003/cc787940(v%3dws.10)).
24
+
SAC is included in all versions of Windows since Windows Server 2003. By default, however, it's disabled. SAC relies on the `sacdrv.sys` kernel driver, the `Special Administration Console Helper` service (`sacsvr`), and the `sacsess.exe` process. For more information, see [Emergency Management Services Tools and Settings](/previous-versions/windows/it-pro/windows-server-2003/cc787940(v%3dws.10)).
25
25
26
-
SAC allows you to connect to your running OS via serial port. When you launch CMD from SAC, `sacsess.exe`launches`cmd.exe` within your running OS. You can see that in Task Manager if you RDP to your VM at the same time you're connected to SAC via the serial console feature. The CMD you access via SAC is the same `cmd.exe` you use when connected via RDP. All the same commands and tools are available, including the ability to launch PowerShell from that CMD instance. That is a major difference between SAC and the Windows Recovery Environment (WinRE) in that SAC is letting you manage your running OS, where WinRE boots into a different, minimal OS. While Azure VMs don't support the ability to access WinRE, with the serial console feature, Azure VMs can be managed via SAC.
26
+
SAC enables you to connect to your running OS through a serial port. When you open a Command Prompt window in SAC, `sacsess.exe`starts`cmd.exe` within your running OS. In Task Manager, you can see that if you connect through RDP to your VM at the same time as you're connected to SAC through the serial console feature. The CMD window that you access through SAC is the same as the `cmd.exe`window that you use when you connect through RDP. All the same commands and tools are available, including the ability to start PowerShell from that CMD instance. The major difference between SAC and the Windows Recovery Environment (WinRE) is that SAC lets you manage your running OS, but WinRE starts up into a different, minimal OS. Although Azure VMs don't support the ability to access WinRE, they can be managed through SAC.
27
27
28
-
Because SAC is limited to an 80x24 screen buffer with no scroll back, add `| more` to commands to display the output one page at a time. Use `<spacebar>` to see the next page, or `<enter>` to see the next line.
28
+
Because SAC is limited to an 80x24 pixel screen buffer that has no scroll back capability, add `| more` to commands to display the output one page at a time. Use `<spacebar>` to see the next page, or `<enter>` to see the next line.
29
29
30
-
`SHIFT+INSERT` is the paste shortcut for the serial console window.
30
+
The paste shortcut for the serial console window is `SHIFT+INSERT`.
31
31
32
-
Because of SAC's limited screen buffer, longer commands may be easier to type out in a local text editor and then pasted into SAC.
32
+
Because of SAC's limited screen buffer, it might be easier to manage longer commands by copying them from a local text editor to SAC.
33
33
34
-
## View and Edit Windows Registry Settings using CMD
34
+
## Use CMD for Windows registry settings
35
35
36
-
### Verify RDP is enabled
36
+
To view and edit Windows registry csettings by using CMD, follow these steps:
The second key (under \Policies) would only be needed if the relevant group policy setting is configured. 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.
51
53
52
-
## Manage Windows Services using CMD
54
+
## Use CMD to manage Windows services
53
55
54
-
### View service state
56
+
To manage Windows services by usign CMD< follow these steps:
**Note:**A space is required after the equal sign.
67
71
68
-
###Set service start type
72
+
1. Set service start type:
69
73
70
74
`sc config termservice start= demand`
71
75
72
-
A space is required after the equals sign. Possible start values include `boot`, `system`, `auto`, `demand`, `disabled`, `delayed-auto`.
76
+
**Note:**A space is required after the equal sign. Possible start values include:`boot`, `system`, `auto`, `demand`, `disabled`, and`delayed-auto`.
73
77
74
-
###Set service dependencies
78
+
1. Set service dependencies:
75
79
76
80
`sc config termservice depend= RPCSS`
77
81
78
-
A space is required after the equals sign.
82
+
**Note:**A space is required after the equal sign.
79
83
80
-
###Start service
84
+
1. Start service by running either of the following commands:
81
85
82
86
`net start termservice`
83
87
84
-
or
85
-
86
88
`sc start termservice`
87
89
88
-
###Stop service
90
+
1. Stop the service by running either of the following commands:
89
91
90
92
`net stop termservice`
91
93
92
-
or
93
-
94
94
`sc stop termservice`
95
95
96
-
## Manage Networking Features using CMD
96
+
## Use CMD to manage networking features
97
97
98
-
### Show NIC properties
98
+
Use manage networking features by using CMD, follow these steps:
99
99
100
-
`netsh interface show interface`
100
+
1. Show the network shell (netsh) properties:
101
101
102
-
### Show IP properties
102
+
> `netsh interface show interface`
103
+
104
+
1. Show IP properties:
103
105
104
-
`netsh interface ip show config`
106
+
> `netsh interface ip show config`
105
107
106
-
###Show IPSec configuration
108
+
1. Show IPSec configuration:
107
109
108
110
`netsh nap client show configuration`
109
111
110
-
###Enable NIC
112
+
1. Enable the network shell interface:
111
113
112
114
`netsh interface set interface name="<interface name>" admin=enabled`
113
115
114
-
###Set NIC to use DHCP
116
+
1. Set the netsh interface to use DHCP:
115
117
116
118
`netsh interface ip set address name="<interface name>" source=dhcp`
117
119
118
-
For more information about `netsh`, [click here](/windows-server/networking/technologies/netsh/netsh-contexts).
120
+
For more information about `netsh`, see [Network shell (netsh)](/windows-server/networking/technologies/netsh/netsh-contexts).
119
121
120
-
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 static IP to the VM.
122
+
Azure VMs should always be configured in the Guest OS to use DHCP to get an IP address. The Azure static IP setting still uses DHCP to give the static IP to the VM.
0 commit comments