Windows Tweaks - kennethjiang/Wolke GitHub Wiki

Schedule DHCP renew:

create: c:\ipreconfig.bat

@echo off

: loop

ping 1.0.0.0 -n 1 -w 10000 >NUL

ipconfig /all >>c:\ip.log
ipconfig /all>c:\ip.out
findstr 169.254 c:\ip.out || goto loop

ipconfig /renew >>c:\ip.log
ipconfig /all >>c:\ip.log

goto loop

Use the Group policy editor to make sure this script runs on startup.

%systemroot%\system32\gpedit.msc
User Config\Windows Settings\Scripts\Logon/Logoff
Computer Config\Windows Settings\Scripts\Startup/Shutd

Change NTP Server:

http://www.windowsnetworking.com/articles_tutorials/configuring-windows-time-service.html

What I did: HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer

This registry entry specifies a space-delimited list of stratum 1 time servers from which the local computer can obtain reliable time stamps. The list may consist of one or more DNS names or IP addresses (if DNS names are used then you must append ,0x1 to the end of each DNS name). For example, to synchronize the PDC Emulator in your forest root domain with tock.usno.navy.mil, an open-access SNTP time server run by the United States Naval Observatory, change the value of the NtpServer registry entry from time.windows.com,0x1 to tock.usno.navy.mil,0x1 here. Alternatively, you can specify the IP address of this time server, which is 192.5.41.209 instead.

Now stop and restart the Windows Time service using the following commands:

net stop w32time

net start w32time

在Windows上安装ssh执行远程命令:

  1. 安装winsshd:http://www.bitvise.com/winsshd-download
  2. 右键任务条winsshd,settings -> edit -> Windows Firewall. 把SSH port改为“Open ports to any computer"
  3. 在winsshd control panel中启动ssh服务。或重启机器ssh服务会自动启动
  4. 在linux上,执行“ssh-keygen -f ./win-admin"
  5. 把linux当前目录下win-admin.pub拷贝到window上
  6. 右键任务条winsshd,settings -> edit -> Access Control -> Windows accounts -> "Add"。Windows account name填“administrator"。再点击"public keys" -> "import...", 选择从Linux上拷贝过来的win-admin.pub。
  7. 在linux上使用“ssh -i win-admin administrator@windows_ip“登录windows服务器。第一次登录时需要密码,winsshd将会cache这个密码。之后的登录就无需密码了。
  8. 在linux上执行远程命令,如 ssh -i win-admin administrator@windows_ip “netdom renamecomputer localhost /NewName:dc /reboot:5 /Force”

如果使用bitvise的tunnelier,步骤4,5,7,8应作相应调整。