初始化、基础配置.note

noteId: WEB43e908d7d9f20bc8c5bd6509ed11bd4a · 原始路径:/ALL/世赛题目(练习) - 笔记/第48届/08-集训队解题/B/初始化、基础配置.note · 图片:2 · 附件待处理:0

 
 
1、ip、主机名:
netsh interface ip set address Ethernet0 static 172.16.0.1 255.255.255.0 172.16.0.254
 
hostname    //查看当前主机名,并复制
netdom renamecomputer WIN-BGHRUJP823J /newname:iqaluiT_S1
 
2、放行 防火墙策略:
new-netfirewallrule -dis pass -name pass
 
3、关闭接口 IPv6功能:
# ServerCore:
Disable-NetAdapterBinding -Name Ethernet0 -ComponentID ms_tcpip6
 
图形化直接在ncpa.cpl中取消勾选 IPv6即可
 
 
4、关闭睡眠:
powercfg /change standby-timeout-ac 0
powercfg /change monitor-timeout-ac 0
 
 
5、客户端 启用 administrator账户并设置密码:
net user administrator /active:yes
net user administrator Skills39
net user skills Skills39    //更改普通用户的密码
 
6、设置用户密码永不过期:
Set-LocalUser -Name "skills" -PasswordNeverExpires $true
 
7、ServerCore 启用路由功能:
regedit
重启机器生效
 
 
·一键汇总:
Set-LocalUser administrator -PasswordNeverExpires $true
 
new-netfirewallrule -dis pass -name pass
 
# 直接用 *:Disable-NetAdapterBinding -Name * -ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name Ethernet0 -ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name Ethernet1 -ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name Ethernet2 -ComponentID ms_tcpip6
 
powercfg /change standby-timeout-ac 0
powercfg /change monitor-timeout-ac 0