添加本地用户

添加新的本地用户。

在CUI配置上,按如下方式设置。

  • 使用管理员权限运行 PowerShell 并按如下方式进行配置。
Windows PowerShell
版权所由 (C) Microsoft Corporation。 保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
# 例如,添加 [NC086] 用户
# [P@ssw0rd01] ⇒您设置的密码(根据需要替换)
# [PasswordNeverExpires] ⇒设置密码永不过期(如果设置默认过期,则不指定此选项)
PS C:\Users\Administrator> New-LocalUser -Name "NC086" `
-FullName "NC086" `
-Description "此计算机的管理员" `
-Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd01" -Force) `
-PasswordNeverExpires `
-AccountNeverExpires Name Enabled Description
---- ------- -----------
NC086 True 此计算机的管理员 # 如果向用户授予权限,请将其添加到 [管理员] 组
PS C:\Users\Administrator> Add-LocalGroupMember -Group "Administrators" -Member "NC086" # 验证
PS C:\Users\Administrator> Get-LocalUser -Name NC086 Name Enabled Description
---- ------- -----------
NC086 True 此计算机的管理员 PS C:\Users\Administrator> Get-LocalGroupMember -Group "Administrators" ObjectClass Name PrincipalSource
----------- ---- ---------------
User WIN-PA24S3GQ6G3\Administrator Local
User WIN-PA24S3GQ6G3\NC086 Local # 如果删除用户,请执行如下操作
PS C:\Users\Administrator> Remove-LocalUser -Name "NC086"

在GUI配置上,按如下方式设置。

  • 运行【服务器管理器】并打开【工具】【计算机管理】。

  • 右键单击左侧窗格中【本地用户和组】下的【用户】,然后选择【新建用户】。

  • 输入新用户的用户名和密码后,点击【创建】按钮。其他 intems 是可选设置的。

  • 创建成功后,新用户将显示在列表中,如下所示。

  • 如果要为新用户设置管理权限,请右键单击该用户并打开【属性】。

  • 移至【成员】选项卡,然后单击【添加】按钮。

  • 指定【管理员】组,如下所示。

  • 确保列表中添加了【管理员】组,然后单击【确定】按钮完成设置。

  • 在【Administrators】组属性中,用户已添加。

更改管理员用户名

如果出于某些原因(如安全性)想要更改管理员账户名称,可以进行如下更改。

在CUI配置上,按如下方式设置。

Windows PowerShell
版权所由 (C) Microsoft Corporation。 保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
# 例如,将名称 [Administrator] 更改为 [NC086Admin]
PS C:\Users\Administrator> Rename-LocalUser -Name "Administrator" -NewName "NC086Admin" PS C:\Users\Administrator> Get-LocalUser # changed
Name Enabled Description
---- ------- -----------
DefaultAccount False A user account managed by the system.
Guest False Built-in account for guest access to the computer/domain
NC086 True 此计算机的管理员
NC086Admin True Built-in account for administering the computer/domain
WDAGUtilityAccount False A user account managed and used by the system for Windows Defender Application Guard scenarios.

在GUI配置上,按如下方式设置。

  • 运行【服务器管理器】并打开【工具】【计算机管理】。

  • 在左窗格中打开【本地用户和组】【用户】,然后右键单击【管理员】,然后在右窗格中选择【重命名】。然后,更改您喜欢的任何名称。

  • 管理员名称刚刚更改。

设置计算机名称

默认情况下,计算机名称是自动分配的,因此请更改它。

在CUI配置上,按如下方式设置。

  • 使用管理员权限运行 PowerShell 并按如下方式进行配置。
Windows PowerShell
版权所由 (C) Microsoft Corporation。 保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
# 例如,将“计算机名称”更改为 [NC086]
PS C:\Users\Administrator> Rename-Computer -NewName NC086 -Force -PassThru HasSucceeded OldComputerName NewComputerName
------------ --------------- ---------------
True WIN-VIMPQCFFRBH NC086
WARNING: The changes will take effect after you restart the computer WIN-VIMPQCFFRBH. # 例如,将主 DNS 后缀更改为 [ncncet.com]
PS C:\Users\Administrator> Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" –Name "NV Domain" –Value "ncncet.com" -PassThru NV Domain : ncncet.com
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip
PSChildName : Parameters
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry # 重新启动计算机以应用更改
PS C:\Users\Administrator> Restart-Computer -Force # 验证
PS C:\Users\Administrator> (ipconfig /all)[0..9] Windows IP Configuration Host Name . . . . . . . . . . . . : NC086
Primary Dns Suffix . . . . . . . : ncncet.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : ncncet.com

在GUI配置上,按如下方式设置。

  • 运行【服务器管理器】,在左侧窗格中选择【本地服务器】,然后单击右键窗格中的【计算机名称】部分。

  • 移至【计算机名称】选项卡,然后单击【更改】按钮。

  • 在【计算机名称】字段中输入您喜欢的任何计算机名称,然后单击【更多...】按钮。(:彩蛋

  • 输入此计算机所在的域名。

  • 应用更改需要重新启动计算机。

  • 计算机名称已成功更改。

设置静态IP地址

默认情况下,IP地址由DHCP分配,因此请为服务器使用设置静态IP地址。此示例显示仅设置IPv4地址。

在CUI配置上,按如下方式设置。

  • 使用管理员权限运行 PowerShell 并按如下方式进行配置。
Windows PowerShell
版权所由 (C) Microsoft Corporation。 保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
# display network interfaces
PS C:\Users\Administrator> Get-NetIPInterface -AddressFamily IPv4 ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
11 Ethernet0 IPv4 1500 25 Enabled Connected ActiveStore
1 Loopback Pseudo-Interface 1 IPv4 4294967295 75 Disabled Connected ActiveStore # set DHCP off(将 InterfaceIndex 编号替换为您自己的环境(上面的 ifIndex))
PS C:\Users\Administrator> Set-NetIPInterface -InterfaceIndex 6 -Dhcp Disabled # 例如,设置 IP 地址 [192.168.200.101/24], gateway [192.168.200.1]
PS C:\Users\Administrator> New-NetIPAddress -InterfaceIndex 11 -AddressFamily IPv4 -IPAddress "192.168.200.101" -PrefixLength 24 -DefaultGateway "192.168.200.1" IPAddress : 192.168.200.101
InterfaceIndex : 11
InterfaceAlias : Ethernet0
AddressFamily : IPv4
Type : Unicast
PrefixLength : 24
PrefixOrigin : Manual
SuffixOrigin : Manual
AddressState : Preferred
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : ActiveStore # 例如,设置 DNS [192.168.200.1]
PS C:\Users\Administrator> Set-DnsClientServerAddress -InterfaceIndex 11 -ServerAddresses "192.168.200.101" -PassThru InterfaceAlias Interface Address ServerAddresses
Index Family
-------------- --------- ------- ---------------
Ethernet0 11 IPv4 {192.168.200.101}
Ethernet0 11 IPv6 {} # 确认设置
PS C:\Users\Administrator> ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : NC086
Primary Dns Suffix . . . . . . . : ncncet.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : ncncet.com Ethernet adapter Ethernet0: Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
Physical Address. . . . . . . . . : 00-0C-29-D9-45-D3
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::74:ecfd:e898:b756%7(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.200.101(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.200.1
DHCPv6 IAID . . . . . . . . . . . : 100666409
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2D-E2-30-C2-00-0C-29-D9-45-D3
DNS Servers . . . . . . . . . . . : 192.168.200.1
NetBIOS over Tcpip. . . . . . . . : Enabled

在GUI配置上,按如下方式设置。

  • 运行【服务器管理器】,在左侧窗格中选择【本地服务器】,然后单击右侧窗格中的【以太网】部分。

  • 双击【以太网】图标。

  • 点击【属性】按钮。

  • 选择【互联网协议版本4】,然后单击【属性】按钮。

  • 为本地网络设置静态IP地址和网关等。

  • 设置静态IP地址后,将在服务器上启用更改。(:彩蛋

Windows 更新

配置 Windows 更新。

  • 右键单击窗口开始图标,然后打开【运行】。

  • 输入【gpedit.msc】和【OK】。

  • 在左窗格中选择【计算机配置】【管理模板】【Windows组件】【Windows更新】,然后单击【配置自动更新】在右窗格中打开。

  • 配置所需的 Windows 更新设置。

允许ICMP回显回复

Windows 防火墙的默认设置会阻止ICMP,因此服务器永远不会使用ping命令从其他主机进行回复。如果要允许ICMP,请按如下方式设置。

在CUI配置上,按如下方式设置。

  • 使用管理员权限运行 PowerShell 并按如下方式进行配置。
Windows PowerShell
版权所由 (C) Microsoft Corporation。 保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
# 允许 ICMPv4
PS C:\Users\Administrator> New-NetFirewallRule `
-Name 'ICMPv4' `
-DisplayName 'ICMPv4' `
-Description 'Allow ICMPv4' `
-Profile Any `
-Direction Inbound `
-Action Allow `
-Protocol ICMPv4 `
-Program Any `
-LocalAddress Any `
-RemoteAddress Any # 确认设置
PS C:\Users\Administrator> Get-NetFirewallRule | Where-Object Name -Like 'ICMPv4' Name : ICMPv4
DisplayName : ICMPv4
Description : Allow ICMPv4
DisplayGroup :
Group :
Enabled : True
Profile : Any
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses : {}

在GUI配置上,按如下方式设置。

  • 运行【服务器管理器】并打开【工具】【高级安全Windows Defender防火墙】。

  • 在左侧窗格中选择【入站规则】,然后单击右键窗格中的【新建规则】。

  • 选择【自定义】。

  • 选择【所有程序】。

  • 在【协议类型】上选择【ICMPv4】。

  • 指定允许ICMP的网络范围。

  • 选择【允许连接】。

  • 选择要允许ICMP的网络配置文件。

  • 在【Nmae】字段中输入任何名称。没关系,您的服务器将回复来自其他主机的ping命令。

  • 没关系,您的 Windows 服务器会回复来自其他计算机的ICMP请求。

(:彩蛋,也有可能是缺你一个评论或点赞哦

Windows Server 2022 初始设置的更多相关文章

  1. 设置Windows Server 2022、Win10、Win11自动登录的简单方法-OK

    这里介绍自己从使用 Windows Server 2003 到 Windows Server 2022 一直都在使用的自动登录系统的方法,屡试不爽.网上讨论的方法太繁琐,所以共享出来,供大家参考.该方 ...

  2. Windows Server 2022 OVF(SLIC 2.6)

    请访问原文链接:https://sysin.org/blog/windows-server-2022-ovf/,查看最新版.原创作品,转载请保留出处. 作者:gc(at)sysin.org,主页:ww ...

  3. 安装Windows Server 2022 - 初学者系列 - 学习者系列文章

    这天要写一个关于系统部署的系列文章,涉及到Windows Server 2022操作系统的安装,所以就写了此文.Windows系列的操作系统安装,以前的博文中都有介绍,这里再次做一个安装描述吧.需要的 ...

  4. Windows Server 2008 MetaFile设置占用内存限制

    最近遇到Windows Server 2008服务器内存持续飙升,48G内存用了99%,查看任务管理器的进程,也没发现具体哪个进程用的内存比较大? 于是,在网上找了了一个查看内存的工具RamMap,具 ...

  5. filebeat7.5.2 在 windows server 2008 R2 设置系统服务报错

    今天在windows server 2008 R2 设置filebeat为系统服务报错(在 windows 10 .windows server 2012.windows server 2019下安装 ...

  6. Windows Server 2016域控制器升级到Windows Server 2022遇到的问题记录Fix error 0x800F081E – 0x20003

    1. 非域控服务器升级 将两台Web服务器和数据库服务器(Windows Server 2016, 2019)成功升级至到Windows Server 2022,非常顺利,一次成功. 直接在Windo ...

  7. 在 Windows Vista、Windows 7 和 Windows Server 2008 上设置 SharePoint 2010 开发环境

    适用范围: SharePoint Foundation 2010 | SharePoint Server 2010 本文内容 步骤 1:选择和预配置操作系统 步骤 2:安装 SharePoint 20 ...

  8. windows server 远程连接设置

    1设置远程连接数修改 服务器安装了Windows Server 2008,现在要增加远程连接,开启服务器上的远程桌面连接,使用管理员账户远程登录.默认情况下Windows Server 2008允许一 ...

  9. Windows Server 2012 R2 设置

    一.任务栏左下角启动服务器管理器,然后进行设置.1.登录不显示服务器管理器 2.本地服务器,看到右边的IE增强的安全配置,如图所示,关闭两项内容.这样就关闭了IE增强安全提示框. 3.“工具”菜单,启 ...

  10. Windows Server 2012 R2 设置 smtp 服务器

    Windows Server 2012/2012 R2:安装和配置 SMTP 服务器 安装 SMTP 服务器 以下是安装 SMTP 服务器功能的步骤: 打开“服务器管理器”:单击键盘上的 Window ...

随机推荐

  1. Java轻松实现,每天给对象发情话!

    一.引言 最近看到一篇用js代码实现表白的文章,深有感触.然后发现自己也可以用java代码实现,然后就开始写代码了,发现还挺有意思的,话不多说开搞实现思路: 使用HttpClient远程获取彩虹屁生成 ...

  2. Pyside2简单案例

    代码: from PySide2.QtWidgets import QApplication, QMainWindow, QPushButton, QPlainTextEdit app = QAppl ...

  3. Qt设置窗口显示到扩展屏

    #include <QDesktopWidget> void Dialog::setDisplayPos() { QDesktopWidget *desktop = QApplicatio ...

  4. HarmonyOS属性动画开发示例(ArkTS)

      介绍 利用ArkUI组件不仅可以实现属性变化引起的属性动画,也可以实现父组件状态变化引起子组件产生动画效果,这种动画为显式动画.效果如图所示: 相关概念 显式动画:提供全局animateTo显式动 ...

  5. Android studio 提示“android qemu-system-i386.exe停止工作”

    解决方案 android studio 关闭AVD时提示"android qemu-system-i386.exe停止工作" 配置虚拟机时"Graphics"选 ...

  6. 调用App Store Connect Api

    对iOS的证书.描述文件.账号.设备等管理,之前都去苹果开发者中心操作,官网上操作也比较繁杂,想搞一些自动化之类的,更是麻烦,有时候官网都打不开-- 其实苹果还提供里一套API接口,创建证书.创建账号 ...

  7. JS - JavaScript 主要知识点(基础夯实)

    纲要 基本类型和引用类型 类型判断 强制类型转换 作用域 执行上下文 理解函数的执行过程 this 指向 闭包 原型和原型链 js 的继承 event loop 基本类型和引用类型 js中数据类型分为 ...

  8. 微信小程序三种授权登录的方式

    经过一段时间对微信小程序的研发后 总结出以下三种授权登录的方式,我给他们命名为'一次性授权''永久授权''不授权' 1.一次性授权常规写法,需要获取用户公开信息(头像,昵称等)时,判断调取授权登录接口 ...

  9. ASP.NET MVC 性能优化和调试

    学习 .NET Core 应用程序的调试技术可以分为以下步骤: 理解基础概念:首先,你需要理解什么是调试以及为什么我们需要调试.理解断点.单步执行.变量监视等基本调试概念. 学习 Visual Stu ...

  10. 这种精度高,消耗资源少的大模型稀疏训练方法被阿里云科学家找到了!已被收录到IJCAI

    简介: 论文通过减少模型稀疏训练过程中需要更新的参数量,从而减少大模型稀疏训练的时间以及资源开销,是首个大模型参数高效的稀疏训练算法PST. 作者:李深.李与超 近日,阿里云机器学习PAI关于大模型稀 ...