Veritas Enterprise Vault-Export All Archives Information to a CSV file using PowerShell

I was working on a Migration of Veritas Enterprise Vault Archives in to Office 365 recently which made me writhing this quick couple of lines to share the approach with others. I’m thinking of elaborating the process in a separate post as this is purely about exporting the existing archive information in to a useful CSV report.

Download CSV icon. File with CSV label and down arrow sign. Comma-separated values. Downloading document concept. Flat design vector icon

When I was looking out, it wasn’t easy to find something useful but hopefully it won’t be hard for others who are in need.

Enterprise Vault Management Shell command:

If you’re looking for a generic output on the ‘Enterprise Vault Management Shell’ itself, the following few lines will get you sorted (see the example below). You can modify the parameters to suit your needs.

Screenshot 2022-12-01 144329

$cmapi = New-Object -ComObject EnterpriseVault.ContentManagementAPI
$as = $cmapi.Archives
$as.Computer = "localhost"
$as.Maximum = 100000
$as.Get()
$as | Format-Table Name, Id, ItemCount,Size, @{n="Size (KB)";e={$_.Size}}, @{n="Size (MB)";e={$_.Size / 1024}}, @{n="Size (GB)";e={$_.Size / 1024 /1024}} 

Injecting output in to a CSV:

A CSV however, can be very handy if you wish to use this option.

$cmapi = New-Object -ComObject EnterpriseVault.ContentManagementAPI
$as = $cmapi.Archives
$as.Computer = "localhost"
$as.Maximum = 100000
$as.Get()

$as | Select-Object Name, Id, ItemCount,Size, @{n="Size (KB)";e={$_.Size}}, @{n="Size (MB)";e={$_.Size / 1024}}, @{n="Size (GB)";e={$_.Size / 1024 /1024}} | Export-CSV -NoTypeInformation -Path "D:\FileNameGoesHere.csv"  -Delimiter ',' -Encoding UTF8

(Note that we now have changed “Format-Table” in to “Select-Object”)

Here’s how it will look like when exported.

Screenshot 2022-12-01 151651

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s