Comments

Latest Posts

Windows Server Configuration Tips and Tricks

Building a lab to test some Windows services , AD, DNS, DHCP, ADCS, etc. in my VMware ESXi 6 environment, to get it running smoothly and reduce some headache, I used following tricks to make my life easier.



Most of work has to be done by Group Policy Management Editor. If you are running in a domain environment, create this setting accordingly in a GPO, otherwise configure the local GPO (gpedit.msc):

Edit Default Group Policy


Launch Group Policy Management



Note: In order to refresh the policy type the following command: “gpupdate /force”  in the CMD window and click ENTER.


Enable Ping Through Windows Firewall

  1. Search for Windows Firewall, and click to open it.


  2. Click Advanced Settings on the left.
  3. From the left pane of the resulting window, click Inbound Rules.
  4. In the right pane, find the rules titled File and Printer Sharing (Echo Request - ICMPv4-In).
  5. Right-click each rule and choose Enable Rule.


Disable Password Complexity Verification

Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Account Policy -> Password Policy -> Password must meet complexity requirements -> Disabled


Disable Ctrl+Alt+Del


Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> Interactive Logon: Do not require CTRL+ALT+DEL



Disable windows auto-lock timeout


Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> Interactive logon: Machine inactivity limit

If you wannt prevent lockout set it to zero, keep in mind the security impact this change can have dependent on your environment.



Or:

To do so, open the Group Policy Object Editor and then navigate to Computer Configuration \ Policies \ Administrative Templates \ System \ Power Management \ Video and Display Settings. The setting that controls the lock is called Turn Off the Display (Plugged in).  To disable the lock, enable this setting and change the value of Turn Off the Display (Seconds) to 0.






Disable IE Enhanced Security Configuration


In Windows Server 2012, advanced security is automatically enabled for Internet Explorer, which can interfere with downloading the software or browsing Internet. You can disable advanced security for Internet Explorer in Server Manager as follows: Open Server Manager and on the left side, click Local Server . On the right side, click the On link next to IE Enhanced Security Configuration in the Properties section.


  1. Launch Group Policy Management Console and EDIT and existing policy or CREATE a new policy
  2. Expand: COMPUTER CONFIGURATION > POLICIES > ADMNISTRATIVE TEMPLATES > WINDOWS COMPONENTS > INTERNET EXPLORER > INTERNET CONTROL PANEL > SECURITY PAGE > INTERNET ZONE
  3. Double click TURN ON PROTECTED MODE
  4. Select ENABLED
  5. Select DISABLED from the PROTECTED MODE selection box.


If you want to use a GPO to disable ENHANCED PROTECTED MODE (which is under TOOLS > INTERNET OPTIONS > ADVANCED > security section):

  1. Launch Group Policy Management Console and EDIT and existing policy or CREATE a new policy
  2. Expand: COMPUTER CONFIGURATION > POLICIES > ADMNISTRATIVE TEMPLATES > WINDOWS COMPONENTS > INTERNET EXPLORER > INTERNET CONTROL PANEL > ADVANCED PAGE
  3. Double click TURN ON ENHANCED PROTECTED MODE
  4. Select DISABLED


Command Line : Server Configuration


SCONFIG was initially developed for Microsoft Hyper-V Server 2008, a free virtualization platform that is based on Windows Server 2008 RTM Core and that has the Hyper-V role pre-installed. There have been clients who have gone ahead and copied the script onto their Core installations on other machines. Since then, SCONFIG was made a  part of the R2 release of Windows Server 2008.

With SCONFIG you can manage many aspects of the Server Core machine. SCONFIG dramatically eases server configuration for Windows Server 2008 R2 core deployments. With SCONFIG, you can easily set your system up, get it on the network so you can easily manage the server remotely.

To run SCONFIG simply enter sconfig.cmd in the command prompt window, and press Enter.

Options:
1) Domain/Workgroup
2) Computer Name
3) Add Local Administrator
4) Configure Remote Management
5) Windows Update Settings
6) Download and Install Updates
7) Remote Desktop
8) Network Settings
9) Date and Time
10) Help improve the product with CEIP
11) Windows Activation
12) Log Off User
13) Restart Server
14) Shut Down Server
15) Exit to Command Line


CredSSP Encryption Oracle Remediation Error – Remote Desktop Connection

服务器远程连接发生身份验证错误解决方案

The recent Windows 10 updates released in May 2018 have introduced some improvements to the security of some protocols, eliminating problems related to known vulnerabilities. Among these, new security rules have been introduced on some CredSSP protocol vulnerabilities in the RDP authentication phase.

Unfortunately this has caused for a large number of users the appearance of the following error when making a remote connection via RDP:问题描述一:服务器远程连接发生身份验证错误,要求的函数不受支持解决方案


Solution:
  • Click on Start, then Run (oppure tasto Windows + R) and type gpedit.msc
  • In the mask that will appear, select COMPUTER CONFIGURATION –> ADMINISTRATIVE SETTINGS –> SYSTEM –> CREDENTIALS DELEGATION; once there, select CredSSP encryption oracle remediation in the rightmost section of the window.
  • In the modal window that will appear, select ENABLED and then, in the dropdownlist below, select VULNERABLE, just like in the screenshot below:
“计算机配置”->“管理模板”->“系统”->“凭据分配” 设置名称"加密 Oracle 修正"为已启用和易受,并确定就可以了。

问题描述二:通过以上方法出现“加密Oracle修正”策略路径缺失解决方案
电脑上根本找不到"加密 Oracle 修正"这一项,也没有微软最近更新的那个KB4103718补丁,使用修改注册表的方法。
  • Click on Start, then Run (oppure tasto Windows + R) and type regedit
  • Navigate through HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters\
  • Create the AllowEncryptionOracle key (or change it, if already present) by setting its value to DWORD 2 (the default value should be 1).
  1. 打开注册表,快捷输入 “regedit”(类似找命令提示符 输入 cmd 一样)
  2. 找文件夹 路径:[HKEYLOCALMACHINE]\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters        一般到System 后就没有了,可以自己手动创建文件夹。
  3. 然后再最底部文件夹里面 新建 DWORD(32)位的。 文件名 “AllowEncryptionOracle” ,值 : 2
  4. 最后点 保存 就可以登陆远程桌面了 (如有必要,可以重启一下)
  5. 如果嫌弃以上步骤麻烦,直接复制以下内容到记事本(命名随意),把txt后缀改成reg,打开运行,即可自动导入到注册表。
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters]
    "AllowEncryptionOracle"=dword:00000002
Reference:


Configure Windows Server NTP Server


配置时间NTP服务器:
1
①在DC服务器上输入“regedit”,打开注册表,找到:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters将Type的值修改为“NTP

2
②修改HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config将announceFlags值改为5:




3
③修改HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer将Enabled值改为1




4④重启windows time服务
⑤把防火墙关闭,或者在CMD命令提示符下输入:“netsh firewall add portopening protocol = UDP port =123 name = NTPSERVER”来放行这个端口的流量。


GPO Deploy MSI/MST package Error

Sometimes, even you set group policy to deploy a MSI/MST package correctly, you might still get problems to remote deploy the package.

here are some common solutions I had it before
  • Enable "Computer Configuration\Policies\Administrative Templates\System\Logon\Always wait for the network at computer startup and logon" 
  • Enable "Computer Configuration\Policies\Administrative Templates\System\Group Policy\Specify Startup policy processing wait time" set to at least 30 seconds. Default 120 seconds might be too long.

  • Make sure you can install the package on one of your client through distribution point manually. Just open share folder from remote client, and manually install the package you need to deploy through gpo to see if there is any error. common error is the remote client is missing certain version's .net frameworks. 

Some group policy troubleshooting commands:

  • gpupdate /force
  • rsop.msc
  • gpresult /s gppolicy.html

note: use PDG free software to deploy software/script/application



Clear RDP Session History

Script:
@echo off
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default" /va /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers"
cd %userprofile%\documents\
attrib Default.rdp -s -h
del Default.rdp

Start Your Program Automatically After Reboot


Open Startup folder:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Or using win+r, enter shell:startup

Put your program shortcut into this folder

Next reboot, you will find your program start it automatically.




No comments