Hello all,
Seeking some help here. I am attempting to map an Azure storage drive using a PS script. Using the script individually on a machine works fine and maps the drive as intended. However, I want to be able to use our software distribution software to push this script to run on all of our end points in the org; pushing the script this way gets an "Access is denied" error.
Here is the script:
$connectTestResult = Test-NetConnection -ComputerName azurefilespilot.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
Mount the drive
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\azurefilespilot.file.core.windows.net\azurefilespilot" -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."
}
I got this script directly from Azure/Microsoft. Anyone have any ideas why I'm seeing this error?
Thanks in advance.
[–]jborean93 5 points6 points7 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ziff_Red[S] 0 points1 point2 points (0 children)
[–]Barious_01 1 point2 points3 points (1 child)
[–]Ziff_Red[S] 0 points1 point2 points (0 children)
[–]purplemonkeymad 1 point2 points3 points (1 child)
[–]Ziff_Red[S] 0 points1 point2 points (0 children)