0

I'm trying to build a custom VeeamZip backup script using PowerShell from a Windows 7 box. The box doesn't have the space requirements to hold the actual data itself, it's just the catalyst to manage the VeeamZip files.

I've been hunting around and found a solution here on SO to work around the fact that the PS-Drive command doesn't function using the -Credentials flag in PowerShell 2.0 using this snippet:

$net = new-object -ComObject WScript.Network
$net.MapNetworkDrive("u:", "\\share\point", $false, "user", "pass")

I can verify this is properly mounting the share and is searchable using Powershell, but when using the VeeamZip Powershell commands, the path U:\ isn't available.

I tried then using the net use command in Powershell which also mounted the volume, but even with /persistent:yes it won't show in Explorer and the backups fail.

What can I do? There has to be option to get this to work. I'm a Linux guy so I'm not powershell wiz.

EDIT: I've now updated to Powershell 3.0 and I still can't get it work...

I'm trying the following snippet, but only Powershell has access the new drive:

$credential = Get-Credential
New-PSDrive -Name V -PSProvider FileSystem -Root \\server\share -Credential $credential -Persist

EDIT: The New-PSDrive function now works to mount the volume in Explorer and can be browsed as expected as long as I don't launch PowerShell as administrator. The dilemma is now that I can't use the VeeamZip tool because it requires Admin to function. Ideas welcome.

Andrew
  • 968
  • 2
  • 11
  • 22
  • Are you aware that in Windows, network drive maps are per user? Why not just use UNC path instead of a drive letter? – vonPryz May 26 '16 at 14:26
  • I need to authenticate to the SMB share, which is an off-domain machine and has different credentials then what are being used on the system hosting Veeam. Also, how would network drives being per-user affect my situation? I'm not familiar with how VeeamZip works in the background, so this could be a total unicorn type solution. – Andrew May 31 '16 at 11:53

0 Answers0