PowerShell script exchange
Post Reply
fswipes
Lurker
Posts: 1
Liked: never
Joined: Dec 25, 2014 12:59 am
Full Name: Francis Swipes
Contact:

Repository size using powershell

Post by fswipes »

After looking at the SAMReport for Veeam I decided to try it on our system - seems to be everything any red-blooded Veeam user could ask for. When I run the report, I get an error attempting to load [Veeam.Backup.Core.CRemoteWinFileCommander] - it doesn't seem to be available. I can load [Veeam.Backup.Core.CRemoteWinFile] but that doesn't have a Create method and the rest of the report (at least as far as the repository information) is blank. What am I missing? I am running Veeam 8.0.0.817.

Thanks for any assistance.
veremin
Product Manager
Posts: 20389
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Repository size using powershell

Post by veremin »

The said script was interacting more or less directly with the internal database structure which changes from version to version. So, typically there are no guarantees that such scripts will work on all product versions. The mentioned method must have been removed in version 8, thus, the script doesn't work any longer. Thanks.
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Re: Repository size using powershell

Post by pizzim13 »

I just switched to using WMI. Ideally this should be a CIM call since WMI will be deprecated.

Code: Select all

    
foreach ($Repo in (Get-VBRBackupRepository)) 
        {
        $RepoServer = $Repo.GetHost()
        $RepoDrive = "'"+$repo.Path.Split("\")[0]+"'"
        $storage = Get-WmiObject Win32_LogicalDisk -ComputerName $Repo.GetHost().RealName -Filter "DeviceID=$RepoDrive"
        $storage 
        }
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests