2019年8月23日 星期五

【VPN】【網路】為什麼連上VPN後無法連到伺服器的資料夾

前幾天某一外點同事發問說『為什麼無法連到伺服器的共享資料夾?』一時間還以為是網路設定跑掉了;但在重新設定後 ( netsh ),狀況依然。他還提到一個點『一台電腦可以、另一台不行』!
想起他不能連線的電腦的ip是屬於某一個分享器的,針對那台分享器去測試後發現某些帳號可以 (管理者帳號),某些帳號不行;可是在另一台卻是完全可以的。在向廠商求救後,廠商給予了大概可以進行的檢查:ip設定、port轉送的問題。再把可以的那台ip範圍給也在不行的那台測試後,就可以正常使用了。原來一切原因是 ip衝突 的關係,ip衝突也不會有任何警告,真是一個要注意的地方。

2019年8月14日 星期三

【伺服器】如何修復 Server 2008

原始參考文章來源:https://www.dell.com/support/article/tw/zh/twdhs1/sln167714/windows-server-%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%E5%BC%95%E5%AF%BC%E6%96%87%E4%BB%B6%E5%9C%A8windows-server2008%E6%88%962008r2%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8D%E5%90%AF%E5%8A%A8?lang=zh


最近公司的伺服器又開不起來,依照 Dell 的教學方式在第一次掛點時可以正常的依文件裡的指示操作;but,人生就是這個 but 這次怎麼按 "修復選項" 也沒有用。

詢問伺服器續簽的廠商說『由於最先不是不找他們簽約,現在這個問題沒辦法幫忙,請問微軟…』(看來只剩下換硬碟的功能,下次乾脆錢省下來,除了主要的那台,其他的自己修)

想說怎麼進個指令模式 (command prompt) 怎麼這麼難,開機後按F8一直都進不了 (當時有接外接硬碟),後來拔掉外接硬碟後,以原本的系統重開機就能以安全模式+指令模式的方式來操作…。

在第11步驟時,由於 copy f:\BootMgr c:\ 是為了要確認 c:\ 下面的檔案在不在而不是要覆蓋,但我不小心的按到 Y ,當場有點傻眼。接下來的步驟 bootrec 的指令都無法用...(應該是用修復光碟開機才會有的指令)。索性直接重開機試試,沒有想到就正常了…還好!


原始參考文章來源:https://www.dell.com/support/article/tw/zh/twdhs1/sln167714/windows-server-%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%E5%BC%95%E5%AF%BC%E6%96%87%E4%BB%B6%E5%9C%A8windows-server2008%E6%88%962008r2%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8D%E5%90%AF%E5%8A%A8?lang=zh
===========文章來源備份(Dell網站) 分隔線=======================

Windows Server: How to Repair the Boot Files in Windows Server 2008 or 2008 R2 if the Server Won't Boot

There are a number of possible causes for the failure of a server to boot into Windows. This article deals with a problem in the boot files and demonstrates how to repair them.

Introduction

When booting to the Windows Recovery Environment (WinRE), the drive letters are assigned on a first-come, first-serve basis. For example, the C: drive in Windows will often have a different letter in WinRE. The DiskPart utility can be used to keep track of the drives and what is stored on them.
  • First Partition: 100 MB System Reserved (No drive letter)
  • Second Partition: 60 GB (C:) OS
  • Third Partition: 1.5 TB (D:) Data
  • DVD Drive: E:


Figure 1: Illustration of Drive lettering in Windows and WinRE (English only)Note: If there is no System Reserved partition. It is okay to select the drive containing the Windows folder.

Restoring Boot Files
Note: The media can be a CD, DVD, or USB storage device

Figure 2: DiskPart result (english only)



Figure 3: Result when no OS is found (English only)

This means that one of the following is true:
  1. Boot to the Windows Server DVD.
  2. Open the command prompt.
    1. Server 2008 R2:
      1. If no driver is needed, press Shift-F10 to open the command prompt.
      2. Continue with step 3.
    2. Server 2008 (or 2008 R2 if a driver is required)
      1. Click Next at the first screen.
      2. Click Repair your computer.
      3. If no driver is needed, click Next and proceed to step vii below.
      4. If a driver is needed, click Load Drivers.
      5. Insert the media containing the needed driver.
      6. Navigate to the folder containing the driver, select it, and click Open.
      7. Click Command Prompt.
  3. The command prompt appears.
  4. Type DiskPart at the command prompt.
  1. Type List vol at the DiskPart prompt.
  2. Write down the drive letter of the DVD drive. In this example, it is F.
  3. Write down the drive letter of the system reserved drive. In this example, it is C.
  4. Type Select vol 1 (assuming volume 1 is the System Reserved volume, as it is here).
  5. Type active. This sets the selected volume as active.
  6. Type exit to return to the command line.
  7. Type Copy f:\BootMgr c:\ at the command prompt. One of two things will happen:
    1. If the file Bootmgr already exists on C:, type N to avoid overwriting it.
    2. If the file Bootmgr doesn't already exist on C:, it will automatically be copied.
  8. Type Bootrec /Fixmbr at the command prompt.
  9. Type Bootrec /Fixboot at the command prompt.
  10. Type Bootrec /rebuildBCD at the command prompt.
    1. If no OS is found, the following appears:
      1. The boot configuration database (BCD) already exists.
      2. The OS is not there.
      3. The OS is damaged beyond the ability of BootRec to recognize it.
    2. If BootRec /RebuildBCD succeeds, it will list any installations of Windows that it found. Press Y to accept and add them to the BCD.
  11. The server is now configured to boot from the proper partition. Close the command prompt and reboot the system into normal mode.

2019年6月19日 星期三

【VirtualBox】如何改變硬碟大小(xp不適用)


使用CloneVDI.exe:https://dotblogs.com.tw/cloudio/2010/01/31/13415
CloneVDI下載:https://forums.virtualbox.org/viewtopic.php?f=6&t=22422&start=0&sid=5e826600cba95ff9d94ea283a3924a69
影片教學:https://www.youtube.com/watch?v=4kYb5um163U

備註:

  • 如果是xp的vm,在使用後,空間不會變大,但還是佔硬碟空間。
  • 如果是其他系統,最好選擇不同的GUID,不然空間仍然不會變大。


2019年6月11日 星期二

[系統]如何設定遠端桌面最大連線數?

有一天,突然遇到了遠端桌面同一時間連線數量的問題,憑著印象記得似乎網路上有人討論過,所以就去搜尋一下:

https://community.dynamics.com/365/b/dynamics365enterprisecloudfronts/archive/2018/01/09/setup-simultaneous-remote-login-for-multiple-users


  1. gpedit.msc 開啟 "本機群組原則編輯器"
  2. 電腦設定→系統管理範本→Windows元件→遠端桌面服務→遠端桌面工作階段主機→連線→限制連線數目

  3. 把上方的 "已啟用" 打開,並在下面的選項「允許的 RD 連線數目上限」設成同時可以連線的數目。


2019年5月27日 星期一

【伺服器】在 Linux 環境中用 Samba 架設 AD 伺服器



原本想要用 2012 或 2008 來架 AD 伺服器的 (需要授權費),但在網路上搜尋後,有找到除了一般的 Windows 安裝外,也可以用 Linux 中的 Samba 4 來架免授權費的 AD 伺服器

[系統] reg 檔的操作


Reg 檔的結構大致如下

不需要特殊文字編輯器,可直接開啟新檔案將副檔名存成 .reg ,記得在檔案開頭加上
Windows Registry Editor Version 5.00 的字串後就是正式的 reg 檔了。

操作方式:
  • 【加註解】 ";" :分號後的文字都屬於註解
  • 【新增】
    • 機碼 []:在 [] 中輸入要新增的機碼,如
      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID]
    • 值 "":每種類別的新增方式不同,如下:
      • 字串 "":直接在 "" 中輸入所要的值,如:"Name"="administrator"
      • DWORD:使用 dword: 後接值,如:"NoWinKeys"=dword:00000001 或
        "NoWinKeys"=dword:1
  • 【刪除】
    • 機碼 []:"-":減號後接要刪除的機碼,如
       [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing]
    • 值 "" :在值後面輸入 =- 就可以直接刪除掉值了,如
      "X 509 Certificate"=-



  • 機碼:直接
  • 值:

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\Store]

2019年5月24日 星期五

【文書】為什麼我兩個 Excel 檔的內容無法直接插入複製的儲存格

前幾天,公司的同仁突然問一個問題,說兩個 Excel 檔在各自選取複製的儲存格後,為什麼無法直接把內容以插入複製的儲存格方式互相作業呢?

這幾天在研究後發現,原來是不同模式惹的禍,也就是要互相操作的檔案要嘛都是 xls,不然就是 xlsx,不能一個 xls 而另一個是 xlsx,最保險方式就是使用相同副檔名的檔案,不是就擇一存檔→關閉→重開檔案。直接另存新檔後相容模式仍然是維持著,會造成同樣的錯誤。




2019年5月21日 星期二

【系統】Windows 7 開機時會卡在網際網路存取那邊




對我的電腦→管理→服務與應用程式→服務

找到

IP HELPerNetworkConnectionsRemoteAccess Connection Manager三個全改為"自動"

【系統】關閉 Windows 10 自動更新


由於公司電腦陸陸續續汰換了許多,而變成了 Windows 10,但討厭的問題來了,Windows 10時常會自動更新,並更新完後自爆 (當機、黑畫面的滑鼠轉圈圈),要如何關閉 Windows 的自爆程式自動更新呢?

方法一:閉閉更新服務

我的電腦→管理→服務→Windows Update (一般 & 相依性)

在"內容"中會看到"啟動類型"的下拉式選單
直接選"已停用"

備註:設定完後仍然會不定時的偷偷更新。

方法二:把DNS改成「220.133.83.46」、「114.35.32.109」、「122.117.37.174」



  • https://workhard.tw/win10-%E5%A6%82%E4%BD%95%E6%B0%B8%E4%B9%85%E9%97%9C%E9%96%89-windows-update-%E8%87%AA%E5%8B%95%E6%9B%B4%E6%96%B0/

  • 檢查是否成功:ping microsoft.com 如果回應為 220.133.83.46 或者 127.0.0.1,表示成功
    備註:沒有試過,但把這些修改放進 hosts 檔 (C:\Windows\System32\drivers\etc) 裡會不會比較好?


    block microsoft links entries here. (要封鎖的 domain 設定如下)
    127.0.0.1 *.download.windowsupdate.com
    127.0.0.1 *.microsoft.com
    127.0.0.1 *.update.microsoft.com
    127.0.0.1 *.windowsupdate.com
    127.0.0.1 *.windowsupdate.microsoft.com
    127.0.0.1 download.microsoft.com
    127.0.0.1 download.windowsupdate.com
    127.0.0.1 ntservicepack.microsoft.com
    127.0.0.1 test.stats.update.microsoft.com
    127.0.0.1 windowsupdate.microsoft.com
    127.0.0.1 wustat.windows.com

    方法三:用 "gpedit.msc" 修改系統管理範本


    首先在桌面同時按下 windows鍵+R鍵 叫出 執行 視窗
    並輸入 “gpedit.msc” 按 確定
    Screenshot_8
    確定後會出現 本機群組原則編輯器 首先點擊左邊的 電腦設定
    再透過右邊視窗點擊 系統管理範本 → Windows 元件 → Windows Update → 設定自動更新
    Disable Windows Update
    點擊兩下後將選項從 尚未設定 更改到 已停用 並按下套用再確定
    Screenshot_17
    回到 Windows Update設定中我們也可以看到選項已經變成永遠不檢查更新且已經灰掉無法變更
    Screenshot_18
    備註:限 Professional 版本以上才會有 "gpedit.msc",不然要另外去抓這個來安裝。

    方法四:以 Regedit 方式關閉

    用記事本編輯一個禁用自動更新.REG內容如下
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]

    "NoAutoUpdate"=dword:00000001
    "AUOptions"=dword:00000001

    然後執行 禁用自動更新.REG 
    https://drive.google.com/open?id=1ZGBbyYb1xa3u1qHTvcLut_i1kGustzFX

    分割線==============================分割線
    NoAutoUpdate
    0: 開啟自動更新
    1 : 禁用自動更新
    AUOptions
    1: 自動更新中的“保持我的電腦最新”已被禁用。
    2: 提醒下載和安裝。
    3: 自動下載並提醒安裝。
    4: 自動下載並自動執行計劃的安裝。


    方法五:閉關更新權限


    找到更新小幫手程式按右鍵→內容→安全性→拿掉 讀的權限

    【工作】MIS職則


    昨天心血來潮突然想整理一下心中所想的東西,順手畫了一下,希望在今年的工作能夠建出 EIP 等伺服器功能。