Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
813 B
2
Indexable
Never
$connectTestResult = Test-NetConnection -ComputerName filetestertwo.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
    # Save the password so the drive will persist on reboot
    cmd.exe /C "cmdkey /add:`"filetestertwo.file.core.windows.net`" /user:`"localhost\filetestertwo`" /pass:`"j/vvPwuNHQ1cHTPa/dQ4+kXgpJ55EnuDkYR+OfufZsgp04tQZZgxpWYXK9Y20SHltCZLwiG2mUCPtyJ14mAqqw==`""
    # Mount the drive
    New-PSDrive -Name Z -PSProvider FileSystem -Root "\\filetestertwo.file.core.windows.net\testfileshare" -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."
}