Windows运维之Windows Server 2016 桌面环境的自动配置脚本
小标 2018-09-25 来源 : 阅读 1874 评论 0

摘要:本文主要向大家介绍了Windows运维之Windows Server 2016 桌面环境的自动配置脚本,通过具体的内容向大家展现,希望对大家学习Windows运维有所帮助。

本文主要向大家介绍了Windows运维之Windows Server 2016 桌面环境的自动配置脚本,通过具体的内容向大家展现,希望对大家学习Windows运维有所帮助。

除非学习要求,还是建议使用Windows 10 LTSB 2016或其他桌面系统。
github:https://github.com/m2nlight/WindowsServerToWindowsDesktop
它的功能是自动启动音频服务、允许未登录关机、禁用Ctrl+Alt+Del登录系统、禁用关机时要求输入关机原因、CPU性能优秀程序、IE安全策略、登录时不现实服务器管理器、禁用密码混淆和长度要求、当前用户密码永不过期,安装Bitlocker、Direct-Play、无线网络、优质Windows音视频体验组件。
将脚本复制到桌面,并且要求管理员权限,去运行,输入y开始配置,会重新启动一次系统,演示效果如图:

 
脚本如下:

 1 @echo off
 2 pushd %~dp0
 3 set gpfile=temp_gpfile
 4 set currentuser=%username%
 5 if "%currentuser%" == "" set currentuser=Administrator
 6 echo Windows Server To Windows Desktop
 7 echo =================================
 8 PowerShell /Command "&{Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty Caption}"
 9 echo Current Domain: %USERDOMAIN%
10 echo Current User: %currentuser%
11 echo.
12 set /p tmpInput=Maybe will restart computer. Are you ready? (Y/N):
13 if "%tmpInput%"=="y" goto :START
14 if "%tmpInput%"=="Y" goto :START
15 echo Canelled.
16 echo Press any key to exit...
17 pause>nul
18 goto :END
19 :START
20 echo (1/3) Config Service
21 echo - Automatic Audio Server
22 PowerShell /Command "&{Import-Module ServerManager}"
23 PowerShell /Command "&{Set-Service "Audiosrv" -StartupType Automatic}"
24 echo (2/3) Config Registry and GroupPolicy
25 echo - Shutdown without logon
26 REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ShutdownWithoutLogon /t REG_DWORD /d 1 /f>nul
27 echo - Disable Ctrl+Alt+Del
28 REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v DisableCAD /t REG_DWORD /d 1 /f>nul
29 echo - Disable Shutdown reason On
30 REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutdownReasonOn /t REG_DWORD /d 0 /f>nul
31 echo - CPU Priority for Program
32 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl /v Win32PrioritySeparation /t REG_DWORD /d 38 /f>nul
33 echo - IE Security Policy
34 REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" /v IsInstalled /t REG_DWORD /d 0 /f>nul
35 REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" /v IsInstalled /t REG_DWORD /d 0 /f>nul
36 Rundll32 iesetup.dll, IEHardenLMSettings
37 Rundll32 iesetup.dll, IEHardenUser
38 Rundll32 iesetup.dll, IEHardenAdmin
39 echo - No autorun Server Manager
40 REG ADD HKLM\Software\Microsoft\ServerManager /v DoNotOpenServerManagerAtLogon /t REG_DWORD /d 1 /f>nul
41 echo - Disable Password complexity and Minimum password length
42 echo [version]>%gpfile%.inf
43 echo signature="$CHICAGO$">>%gpfile%.inf
44 echo [System Access]>>%gpfile%.inf
45 echo MinimumPasswordLength = 0 >>%gpfile%.inf
46 echo PasswordComplexity = 0 >>%gpfile%.inf
47 secedit /configure /db %gpfile%.sdb /cfg %gpfile%.inf /log %gpfile%.log>nul 2>nul
48 del %gpfile%.inf %gpfile%.sdb %gpfile%.log %gpfile%.jfm /f /q
49 echo - %currentuser%‘s Password nerver expires
50 wmic Path Win32_UserAccount Where Name="%currentuser%" Set PasswordExpires="FALSE">nul
51 echo   PasswordExpires List:
52 wmic useraccount get Name,PasswordExpires
53 echo (3/3) Config Windows Feature
54 echo - BitLocker
55 echo - Direct-Play
56 echo - Wireless-Networking
57 echo - qWave
58 echo please wait...
59 PowerShell /Command "&{Install-WindowsFeature "BitLocker","Direct-Play","Wireless-Networking","qWave" -Restart}"
60 echo Completed!
61 echo Press any key to exit...
62 pause>nul
63 :END
64 popd

 
其他的手动配置:见github的readme。

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维windows频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程