- 取得連結
- 以電子郵件傳送
- 其他應用程式
安裝 Microsoft Hyper-V Server 2019 後
在 PowerShell 使用 Set-Location 連線網路分享路徑
出現路徑不存在,連線失敗的錯誤訊息
![](https://raw.githubusercontent.com/txstudio/blogspot-image/master/powershell/enable-allowinsecureguestauth/set-location-get-not-found-path.gif)
先前使用 Hyper-V Server 2016 就沒這個問題
查詢資料後在 Hyper-V Server 2019 加入 AllowInsecureGuestAuth 設定
預設是關閉的,啟用此設定後就可以提供存取
但 Hyper-V Server 沒有 regedit 圖形介面,就用 PowerShell 來設定
使用 PowerShell 啟用 AllowInsecureGuestAuth 設定
確認 AllowInsecureGuestAuth 設定值
Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
![](https://raw.githubusercontent.com/txstudio/blogspot-image/master/powershell/enable-allowinsecureguestauth/show-hklm-parameters.gif)
啟用 AllowInsecureGuestAuth 設定
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters -Name AllowInsecureGuestAuth -Value 1
![](https://raw.githubusercontent.com/txstudio/blogspot-image/master/powershell/enable-allowinsecureguestauth/enable-allowinsecureguestauth-value.gif)
重新確認設定值
Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
![](https://raw.githubusercontent.com/txstudio/blogspot-image/master/powershell/enable-allowinsecureguestauth/recheck-allowinsecureguestauth-value.gif)
設定完成後就可以使用 Set-Location 切換至指定 UNC 路徑
![](https://raw.githubusercontent.com/txstudio/blogspot-image/master/powershell/enable-allowinsecureguestauth/set-location-success.gif)
![](https://raw.githubusercontent.com/txstudio/blogspot-image/master/powershell/enable-allowinsecureguestauth/display-directory-items.gif)
注意
若是生產環境的話還是要評估一下是不是要啟用此設定
參考資料
Guest access in SMB2 disabled by default in Windows 10 and Windows Server 2016
留言
張貼留言