windows Server 2008 R2下Server Core常用命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了windows Server 2008 R2下Server Core常用命令相关的知识,希望对你有一定的参考价值。

1.修改计算机名称

工作组:Netdom RenameComputer %ComputerName% /NewName:08R2ServerCore

域环境中:Netdom RenameComputer %ComputerName% /Newname:08R2ServerCore  /UserD:Administrator  /PasswordD:[email protected]

 

2.设置计算机IP地址

把IP地址设置成动态获取:Netsh Interface ipv4 Set Address Name="本地连接"  Source=DHCP

把IP地址设置成一个静态IP: Netsh Interface ipv4 Set Address  "本地连接" Static  10.0.0.10  255.0.0.0 10.0.0.1

 

3.设置DNS地址

Netsh Interface ipv4 Set DNSServer "本地连接"  202.96.209.133  index=1

4. 关闭防火墙

Netsh Firewall Set Opmode disable

5.开启防火墙80端口

6.将计算机加入域

netdom join %computername% /domain:域名 /userd:域名\有权限的用户名 /passwordd:*

7.将计算机从域中删除

netdom remove %computername% /domain:域名 /userd:域名\有权限的用户名 /passwordd:*

8. 重启计算机和关闭计算机

重启:shutdown /r /t 0

关机:shutdown /s /t 0

9.常见的查看命令

查看已经安装的功能:oclist

查看计算机信息:systeminfo

查看计算机名称:hostname

查看当前计算机端口使用情况:Netstat -na

查看当前的端口的使用情况:Netstat -na | find "80"

查看计算机的激活信息:slmgr.vbs -did

10. 激活命令

使用某一个序列号激活:Slmgr /ipk 11111-22222-33333-44444-55555

自动激活:slmgr /ato

11.用户和组

新建用户:net user Alice [email protected]

删除用户: net user Alice /del

修改用户密码:net user Alice abc123,

新建组: net localgroup SalesGroup

把Alice加入到组SalesGroup: net localgroup SalesGroup Alice  /add

将Alice从组SalesGroup中移出:net localgroup SalesGroup Alice /del

12.配置计算机Web代理地址和端口

netsh winhttp Set  proxy 10.0.0.1:8080

13允许或者禁止ping

 允许ping入:netsh firewall set icmpsetting 8

禁止ping入:netsh firewall Set icmpsetting 8 disable

14.安装和卸载角色:

安装DHCP: Start /w ocsetup DHCPServerCore

卸载DHCP: Start /w ocsetup DHCPServerCore /uninstall

设置为自动启动:sc config DHCPServer Start = auto

其他服务的名称可以通过: oclist来查看

15.升级为RODC

-----先写一个unattend.txt文件,把下列复制到文件中,存放在C盘---

[DCInstall]
InstallDNS=Yes
ConfirmGC=No
CriticalReplicationOnly=Yes
DisableCancelForDnsInstall=no
RebootOncompletion=Yes
ReplicaDomainDNSName=contoso.com
ReplicaOrNewDomain=ReadOnlyReplica
ReplicationSourceDC=server8.contoso.com
SafeModeAdminPassword=abc123,
SiteName=Default-First-Site-Name
UserDomain=contoso.com
UserName=administrator
[email protected]

-------------------------------------

然后在命令行输入:

dcpromo /unattend:"c:\unattend.txt"


以上是关于windows Server 2008 R2下Server Core常用命令的主要内容,如果未能解决你的问题,请参考以下文章

怎么修改Windows server 2008 R2登录密码

如何破解windows server 2008r2远程连接数2个的限制

windows Server 2008 R2下Server Core常用命令

如何在Windows Server 2008 R2下搭建FTP服务

我从Microsoft下载了Windows server 2008 r2的ISO镜像文件,现在要安装server 2008.一直没有安装好,help.

windows server2008r2 如何备份