Free Space of CIFS-Repository

PowerShell script exchange

Free Space of CIFS-Repository

Veeam Logoby marcseitz » Fri Feb 15, 2013 10:20 am

Hi Guys,

we are moving from a Windows-Share to a CIFS-Share and I have to customize our Powerhell Scripts.
At the moment I'm getting the free Space of the Windows Repository with an command like his:
Code: Select all
$myRep = Get-VBRBackupRepository | ?{$.Name -eq "XXX"}
$myServer = $myRep.GetHost()
$MyFileCommander = [Veeam.Backup.Core.CRemoteWinFileCommander]::Create($myServer.Info)
$myStorage = $MyFileCommander.GetDrives([ref]$null) | ?{$_.Name -eq $myRep.Path.Substring(0,3)}
$myFree = [Math]::Round([Decimal]$myStorage.FreeSpace/1GB,0)

I didn't find anything how to do this for a CIFS-Share.
In the B&R Application I can see the free Space of the CIFS Share - But not via Powershell :(


Has anyone an idea how to do this?

Thanks,
Marc
marcseitz
Influencer
 
Posts: 17
Liked: 5 times
Joined: Wed Apr 04, 2012 11:17 am
Full Name: Marc Seitz

Re: Free Space of CIFS-Repository

Veeam Logoby v.Eremin » Fri Feb 15, 2013 11:59 am

In the way I see it, something like this should answer your requirements:

Code: Select all
Add-PSSnapin VeeamPSSnapin
$myRep = Get-VBRBackupRepository | ?{$_.Name -eq "Name of your repository"}
[Math]::Round([Decimal](new-object -com scripting.filesystemobject).getdrive($myRep.path).availablespace/1GB)

I've just tested it and everything seems to work fine.

Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Free Space of CIFS-Repository

Veeam Logoby marcseitz » Fri Feb 15, 2013 12:46 pm

Hi Vladimir,

thanks for your quick answer - Your Snipplet is working!

Now I just have the problem that the Script will return "16384" (16TB).
But the Share has an amount of 35TB :-/

I don't know why there is such an difference. I think, I have to go to use Powershell-CMDlets from my Storage Provider to get the correct values.

Thanks & Regards,
Marc
marcseitz
Influencer
 
Posts: 17
Liked: 5 times
Joined: Wed Apr 04, 2012 11:17 am
Full Name: Marc Seitz

Re: Free Space of CIFS-Repository

Veeam Logoby v.Eremin » Fri Feb 15, 2013 1:03 pm

You mean 35 TB of free space, don’t you? And this value (35 TB) is also shown in the VB&R GUI?

Hard to say what can be the issue, since in my particular environment abovementioned script appears to work properly.

Perhaps, later I’ll come up with some new script that will be responsible for getting free space, using different methods.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Free Space of CIFS-Repository

Veeam Logoby marcseitz » Fri Feb 15, 2013 1:56 pm

Hi,

yes - I'm really talking of 35TB free space!
In the VB&R GUI I can see 35,0TB free!
The System behind is a NetApp Filer, connected to Veeam via CIFS Share.

But no worries - If it doesn't work with Veeam CMDlets, I have to use NetApp-CMDlets to get it working.
Not very nice, but should work too!

Thanks,
Marc
marcseitz
Influencer
 
Posts: 17
Liked: 5 times
Joined: Wed Apr 04, 2012 11:17 am
Full Name: Marc Seitz


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests