Windows Server Core command (specific operations commands for managing server cores)

Source: Internet
Author: User
Tags compact intl administrator password remote rdp

To manage Server Core specific operations commands: 1. Set the password of the local administrator user
Net User Administrator *
Note in the command to include (*) and then press ENTER, and then type the administrator password, so that the password will not be directly exposed to the screen, but instead use * instead.

2. Display computer related information
Hostname
Set
SystemInfo
Ipconfig/all
3. Display Network card information
Netsh interface IPv4 Show interfaces
This command allows you to display information such as the connection status, the IDX number, and the name of the current computer's network card.
Save the current configuration
Netsh interface Dump >myconfig.dat (saves the current network configuration to the Myconfig.dat file)
Restore Network Configuration
NETSH exec myconfig.dat (Restore network configuration from backup file)
4, set the IPv4 static address of the network card
netsh interface ipv4 set address Name= "" Source=static address= mask= gateway=
The name= can be the IDX number of the network card obtained from the previous command, or it can be the network card name. Staticip is the static IPV4 address of the network card, SubnetMask is the subnet code, DefaultGateway is the gateway address.
Example: Netsh interface IPv4 set address Name= "10″static 192.168.0.2 255.255.255.0 192.168.0.1 or
Netsh interface IPv4 set address name= "Local Area Connection" static 192.168.0.2 255.255.255.0 192.168.0.1
5. Set the static DNS server address of the network card
netsh interface ipv4 add dnsserver name= "" Address= index=1
When there are multiple DNS server addresses, this command must be reused, and the value after index must be incremented accordingly.
Dynamically specifying DNS server addresses
netsh interface ipv4 set dnsserver name= "" DHCP
6. Set the network card to obtain the IP address automatically
Netsh interface IPv4 set address name= "IDX" source=dhcp
7. Renaming the network adapter
netsh interface set interface name= "Oldname" newname= "NewName"
8. Disable the network adapter:
netsh interface set interface name= "Name" admin=disabled
9. Join the computer to the domain
netdom join computername/domain:domainname/userd:username/passwordd:*
Note that the computername here is the server machine name, DomainName is the domain-joined domain name, username is the domain user name that has permission to join the domain. Enter the password for the domain user, and then restart the computer to join the domain if the operation succeeds.
10. Remove the computer from the domain
netdom remove computername/domain:domainname/userd:username/passwordd:*
11. Renaming computers that are joined to a domain
Netdom renamecomputer%computername%/newname:/userd:/password:*
12. Renaming of computers that are not domain joined
Netdom renamecomputer Currentcomputername>/newname:
Or
Wmic ComputerSystem where name= "%computername%" rename Name= "New_name"
13. Restart or shut down the computer
Shutdown–r–t 0 (Start computer)
Shutdwon–s–t 0 (Turn off the computer –t set the timeout for turning off the computer, ranging from 0-600 seconds to 30 seconds by default)
14. Enable or disable the Hibernate function
Powercfg–h on: Enabled, off: Disabled
15. System Clock
Configure the computer's clock to synchronize with the PDC emulator in the domain
W32tm/config/update/syncfromflags:domhier
Synchronize computer Clocks now
W32tm.exe/resync/nowait
16. Configure the Server Core computer to use Windows Remote Shell management
Run the WinRM quickconfig on the server core to enable the computer to connect remotely to the Windows Remote shell; Run: winrs-r: cmd on the remote computer, to install the computer name for Server Core, CMD is the specific command to execute. For example: Winrs-r:myservercore dir \ c;
17. Activation of the server
Activating the server automatically
Slmgr.vbs–ato
Remote activation
cscript Slmgr.vbs-ato

Show detailed license information
cscript slmgr.vbs–dlv
18, adjust the date and clock control timedate.cpl.
Regional and language option settings? control intl.cpl.
19. Allow Ping in
netsh firewall set icmpsetting 8
Disable Ping in
netsh firewall set icmpsetting 8 disable
can also be controlled from the remote computer's firewall console
20. User Management
Add a user to the local Administrators group
net localgroup administrators/add \
Remove a user from the local Administrators group
net localgroup Administrators/delete
21. Query the installed driver
sc query type= Driver
22, install the new hardware driver
Enter the folder where the hardware driver is located, run Pnputil-i-A, and Driverinf is the INF file name for the hardware driver.
23. Remove Installed Drivers
SC Delete
24. Service operation
To display a service that is running
sc query or net start
Start the service
SC start or net start
Stop Service
sc stop or net stop
25. Page File operation
Set up a paging file
WMIC Pagefileset where name= "
The Set initialsize=,maximumsize=
For example: WMIC pagefileset where name= "C:\\pagefile.sys" set initialsize=500,maximumsize=1000
Set the initial value of the page file for the C drive to 500MB and the maximum value to 1000MB
Canceling system paging File management
Wmic ComputerSystem where Name= "" Set Automaticmanagedpagefile=false
26. Change of Working Group
Wmic ComputerSystem where name= "" Call JoinDomainOrWorkgroup name= ""
27, Manual repair procedures
Manual Patch: Download the update package from the Web site, and then run
Wusa. Msu/quiet
Uninstalling the installed hotfixes
First use expand/f:*. MSU
Show the installed patches to a folder, and then edit the. Xml in the folder, replace all installs with the remove character, and finally run Pkgmgr/n:.xml.
To query the list of installed hotfixes:
WMIC QFE List
28. Automatic Update operation
Cscript C:\Windows\System32\ scregedit.wsf/au [/v][value]
/V View current auto-update settings
value:4– Enable Automatic Updates--Disable Automatic Updates
29. Change the priority of DNS SRV Records
Cscript C:\Windows\System32\ SCREGEDIT.WSF/DP [/v][value]
/V View DNS SRV priority settings
Value: (value from 0 to 65535, recommended value is 200)
30. Change the weight of DNS SRV Records
Cscript C:\Windows\System32\ SCREGEDIT.WSF/DW [/v][value]
/V View DNS SRV weight settings
Value (values from 0 to 65535, recommended value is 50)
31. Event Log Management
List log Types
Wevtutil El
Querying for events of the specified log type
Wevtutil Qe/f:text
Output Event Log type
wevtutil EPL
Clear Log
wevtutil cl
32. Managing server Roles and Features
Display server roles and features and installation conditions
Oclist
Install Active Directory Roles
For Active Directory roles, you must use Dcpromo/unattend:unattendfile. Here, UnattendFile is the name of the Dcpromo unattended answer file, and note that Dcpromo can also be used when demoting a domain controller to a member server.
Install additional roles and features
START/W OCSetup; It is necessary to install, Get server role and feature name by Oclist, note the name is case-sensitive;/w: Start the application and wait for the end.
Uninstall other installed roles and features
START/W Ocsetup/uninstall
For example:
start/w ocsetup dns-server-core-role Install the DNS server role, and then use the dnscmd command or remotely manage it using the DNS Management console.
start/w OCSetup Dns-server-core-role/uninstall Uninstalling the DNS server role
start/w ocsetup Dhcpservercore Install the DHCP server role, and then use the Netsh command or remotely manage it using the DHCP management console. If you are installing a DHCP server under Active Directory, you must also authorize it in the Active Directory.
start/w OCSetup Dhcpservercore/uninstall Uninstalling the DHCP server role
33. Management of the Customer Experience Improvement Program (CEIP)
Show Windows Server Customer Experience Improvement Program participation status
Serverceipoptin/query
Enable the Windows Server Customer Experience Improvement Program
Serverceipoptin/enable
Disable the Windows Server Customer Experience Improvement Program
Serverceipoptin/disable
34. Management of error reports
Show Windows Error Reporting opt-in status
Serverweroptin/query
Automatically send summary reports using Windows Error Reporting
Serverweroptin/summary
Automatically send detailed reports using Windows Error Reporting
Serverweroptin/detailed
disabling Windows Error Reporting
Serverweroptin/disable.
35. Using Terminal Services Customer Management Server Core
Allow Terminal Services Management mode to accept remote connections first in Server Core
cscript C:\Windows\System32\ Scregedit.wsf/ar 0
If you are running a previous version of the Terminal Services client, you must run cscript C:\windows\system32\scregedit.wsf/cs 0 to allow previous versions of the connection
Second configuration allows remote RDP connections through the firewall
netsh advfirewall firewall set rule group= "Remote Desktop" new Enable=yes
Finally, run MSTSC on the remote computer or open Remote Desktop Connection, and then enter the computer name or IP address of the server to connect. Then, log in with the Administrator account, and when the command-line window appears, use the command line to finish administration, and finally type logoff to end the session.
36, the management of the firewall
Use the netsh firewall command to manage firewalls
Show the status of the firewall
Netsh firewall show state; If the display operational mode is enabled, the firewall is turned on, and the firewall is disabled for disable;
Enable Disable Firewall enabled
Netsh Firewall set Opmode enable| Disable:enable enable firewall, disable– Disable firewall.
Set Firewall port configuration
Netsh Firewall set portopening
[protocol =] tcp| udp| All
[Port =] 1-65535
[[name =] Name
[mode =] enable| DISABLE
Parameters:
protocol– Port protocol.
tcp– Transmission Control Protocol (TCP).
udp– User Datagram Protocol (UDP).
All–all protocol.
port– Port number.
name– port name (optional).
mode– port mode (optional).
The enable– is allowed through the firewall (the default value).
disable– is not allowed through the firewall (the default value).
For example: Turn on printers and file sharing
Netsh Firewall set portopening TCP 139 netbios_139
Netsh Firewall set portopening TCP 445 netbios_445
Netsh Firewall set portopening UDP 137 netbios_137
Netsh Firewall set portopening UDP 138 netbios_138
(139-Port: NetBIOS Session service, 445-port smb;137 port on TCP: NetBIOS Name Service
138 Port: NetBIOS datagram Service;)
Allow Remote Desktop
Netsh Firewall set portopening TCP 3389 remotedesktop
37. Other Commands
Disk partition management: Diskpart/?
Example: The following uses the DiskPart command to partition the second block of hard disk partitions:
Diskpart
List disk (list all disks)
Select Disk 1 (choose newly added disks, 1 is the hard disk number of the new disk)
Create Partition primary (divides the entire hard disk into primary partition, if you want to specify size, add parameter size=xxxx, Unit MB)
Assign letter=e (allocation letter E)
Format Fs=ntfs label= "Diske" quick (the partition is quickly formatted as NTFS, and the volume is labeled Diske)
List volume (list all volumes, will find e-disk)
Software RAID Management: Diskraid/?
Volume mount point management: Mountvol/?
Disk Fragmentation management: Defrag/?
Compressed files: Compact/?
Example: Compact c:\123\123.txt/c compressed c:\123\ file 123.txt
Compact c:\123\123.txt/u extract c:\123\ file 123.txt
Open File Management: Openfiles/?
Convert FAT volumes to Ntfs:convert/fs:ntfs
Allow remote Procedure Calls
Netsh Firewall set portopening TCP 135 Remoteadmin
Show current firewall configuration
Netsh Firewall show config
Description
1, the Server Core does not support the Winver.exe command, to obtain version information, you need to use the Systeminfo.exe command.
2, the Server Core alone does not support running the Control.exe command alone, Control.exe must be run with timedate.cpl or intl.cpl, while the other Control Panel settings command is not supported.
3. When you use the Disk Management console for remote administration, you must run the Net start VDS command on the server Core to start the Virtual Disk service.
4, some commands (rename computer name, etc.) operation, you must restart the computer to be effective.
5. Some commands have different parameters in XP and 2008, for example, using Netsh interface ip set DNS to set DNS server address under XP. Specific parameters refer to the command to help.

Windows Server Core command (specific operations commands for managing server cores)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.