【发布时间】:2021-08-24 09:36:01
【问题描述】:
我正在使用以下命令在 windows azure vm 上挂载文件:
$connectTestResult = Test-NetConnection -ComputerName aaadcstore.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
# Save the password so the drive will persist on reboot
cmd.exe /C "cmdkey /add:`"aaadcstore.file.core.windows.net`" /user:`"Azure\*******`" /pass:`"*****************`""
# Mount the drive
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\aaadcstore.file.core.windows.net\amazefileshare" -Persist
} else {
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
}
但我的连接 TcpTest 未成功我已使用 NSG 打开 445 但仍无法正常工作。
【问题讨论】:
-
你能在虚拟机的 PowerShell 控制台中运行
Test-NetConnection -ComputerName aaadcstore.file.core.windows.net -Port 445并分享输出吗? -
@Gaurav o/p:警告:amazedcstore.file.core.windows.net 的名称解析失败--状态:没有这样的主机已知计算机名称:amazedcstore.file.core.windows.net RemoteAddress : InterfaceAlias : SourceAddress : PingSucceeded : False
-
谢谢。当您从本地计算机运行相同的命令时会发生什么?
-
从本地 o/p 警告:TCP 连接到 (20.60.128.136 : 445) 失败警告:Ping 到 20.60.128.136 失败,状态为:TimedOut ComputerName : amazedcstore.file.core.windows.net RemoteAddress : 20.60.128.136 RemotePort: 445 InterfaceAlias: Wi-Fi 3 SourceAddress: 192.168.1.102 PingSucceeded: False PingReplyDetails (RTT): 0 ms TcpTestSucceeded: False
标签: azure powershell azure-virtual-machine