2019年8月22日 星期四

centos 7 忘記root密碼?

1.重開機3秒內按向下鍵,停留在開機介面。
2.底下有寫按e鍵為edit,就按e鍵。
3.將游標移到linux16開頭,移到ro這裡,改成 rw init=/sysroot/bin/bash 然後同時按ctrl和x 這2鍵,進入emergency模式。
4.執行chroot /sysroot/,再打passwd去變更root密碼,要打2次,這時會出現亂碼,因為為中文字體,如不習慣,在執行chroot /sysroot/前先行LANG=en就可以了。
5.最後執行touch /.autorelabel,這步驟讓SElinux生效。
6.按cerl+d這2鍵,再執行reboot重新開機即可。

2019年7月6日 星期六

修改電腦名稱指令

@echo on
wmic ComputerSystem where Name="舊名稱(原本)" call Rename Name="新名稱"

@echo on
wmic ComputerSystem where Name="%COMPUTERNAME%" call Rename Name="新名稱"

2019年6月6日 星期四

安裝出現2503、2502問題?

安裝office 2003出現2503、2502錯誤,原因就是C:\Windows\Temp文件夾NTFS權限錯誤。只要將現有帳號加入授予完全控制即可。
參考:https://kknews.cc/zh-tw/tech/qenrey.html

2019年4月24日 星期三

做sysprep後,如何刪除之前的使用者?

1.runsysprep後,通常系統會要求再設置一個user account,所以整個系統會有兩個 user account,這對於工廠端人員是不想預見的,誰不想系統大量佈署後只有一個 account,直接就可以讓客戶直接使用呢?所以我在這要教授如何讓系統跑完sysprep後只 會產生一個user account

2.設定password product key、安全設定、時間及日期和網路,設定完之後會產生使用者及使用者目錄。

3.在命令提示列裡輸入:sysprep /audit /quiet /reboot

4.重開機後進入稽核模式,此時是以administrator的帳號登入,此時我們要砍掉我們剛剛建立的使用者帳號。

5.一樣在命令提示列裡執行:sysprep /oobe /generalize /reboot /unattend:filename.xml


此時的再次執行sysprep才是真正的要做封裝動作,所以reboot也可以改成shutdown如果有應答文件要記得將應答文件跟sysprep.exe放在一起,這樣應答文件才有作用。此時 開機完之後就會以一個新的user account進入到系統了。

2019年4月20日 星期六

啟用win10 1803以上的終極效能

使用系統管理員身分,在命令列上執行
c:\>powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
※完成後會冒出一個提示,"終極效能"表示開啟完成
在電源管理那找到"終極效能"模式

2019年4月17日 星期三

Can not Windows update?

  1. Click Start, and in the Search box on the start menu, type CMD, then press Ctrl+Shift+Enter (this will get you an elevation prompt for an Administrator command prompt)
  2. At the command prompt, type net stop wuauserv, then press Enter
  3. Type rmdir /s %windir%\softwaredistribution\DataStore, then press Enter. Type Y to acknowledge the command.
  4. Click Start, and in the Search box on the start menu, type regedit and press Enter
  5. Go to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ WindowsUpdate. Right-click on WindowsUpdate in the tree and choose Delete (confirm deletion). Close Regedit.
  6. At the command prompt, type net start wuauserv, press Enter and close the command prompt.
  7. Use the Windows Update again to install updates.
參考:https://www.windowsbbs.com/threads/can-not-download-updates.97594/

2019年4月8日 星期一

ESXi 5.5~6.5 指令

1.list the power on VMs:
esxcli vm process list  --重要的是找到World ID
若用esxcli vm process list | grep <guest vm name>則只會列出名稱與config file位置

2.turn off the VM:
esxcli vm process kill --type=xxxx --world-id=yyyyy
例如:esxcli vm process kill --type=soft --world-id=60418

for -type=xxxx use: soft, hard or force
for world-id=yyyy(VM ID) use the World ID listed in the command above
(eg. World ID 39731 for the example VM "Cold")
Some information about the three possible shutdown methods:

soft = prefer this if you want to shut down "softly"
hard = equal to an immediate shutdown
force = hard kill of the VM

3.trun on the VM:
list the VM:
vim-cmd vmsvc/getallvms

power on the VM:
vim-cmd vmsvc/power.on <vmid>

Check the power state of the VM
vim-cmd vmsvc/power.getstate <vmid>

check VM  status:
esxcli vm process list

4.reboot the VM:
vim-cmd vmsvc/power.restart (reboot)<vm-id>

5.shutdown the VM:
vim-cmd vmsvc/power.shutdown <vm-id>