From 62bb317c16abad3a7f1b8679500cb4d4c3d4be31 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Wed, 15 Jul 2020 17:16:37 +0300 Subject: [PATCH] Add SIKData mount ps-script --- sikdata-mount.ps | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sikdata-mount.ps diff --git a/sikdata-mount.ps b/sikdata-mount.ps new file mode 100644 index 0000000..e0ba50f --- /dev/null +++ b/sikdata-mount.ps @@ -0,0 +1,9 @@ +$connectTestResult = Test-NetConnection -ComputerName 192.168.0.4 -Port 445 +if ($connectTestResult.TcpTestSucceeded) { +# Save the password so the drive will persist on reboot +cmd.exe /C "cmdkey /add:`"192.168.0.4`" /user:`"Azure\sikdata`” /pass:`"43M1Sa3+rd1e5SJl2FXp+IfcuBISrsq6CWJ0hbEP3bgRrQKNsJc9BoCCcwZ8CEEu9jzEFlHUbu/bGNpBDPlYlw==`"" +# Mount the drive +New-PSDrive -Name Z -PSProvider FileSystem -Root "\\192.168.0.4\sikdata" -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." +} \ No newline at end of file