-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapAzureFiles.ps1
More file actions
11 lines (10 loc) · 847 Bytes
/
MapAzureFiles.ps1
File metadata and controls
11 lines (10 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
# VPN Must be availible
$connectTestResult = Test-NetConnection -ComputerName swarmvfuebbuvstorage.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
# Save the password so the drive will persist on reboot
cmd.exe /C "cmdkey /add:`"swarmvfuebbuvstorage.file.core.windows.net`" /user:`"Azure\swarmvfuebbuvstorage`" /pass:`"/I1cQiPPqf81OTbzZnEVqDIjPcU0h3aNdp2gCnsjB6PHGSRca3Ri/37+a4QBwBIb8TB2O4iuwPtd562bQdTugg==`""
# Mount the drive
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\swarmvfuebbuvstorage.file.core.windows.net\share" -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."
}