Hi Everyone
I have been trying to get my head around Commvault’s PowerShell module and it runs so slow, not sure why. Has anyone else has faced the same issue? Below script returned 3676 objects and it took more than two hours:
Get-Date
$clients = Get-CVClient
$subClientObjs = @()
foreach ($client in $clients){
$subClients = Get-CVSubclient -ClientName $client.clientName -AllProperties
foreach ($subClient in $subClients){
$subClientObj = [PSCustomObject]@{
'clientName' = $subClient.subClientProperties.subClientEntity.clientName
'subClientName'= $subClient.subClientProperties.subClientEntity.subclientName
'backupSetName' = $subClient.subClientProperties.subClientEntity.backupsetName
'clientType' = $subClient.subClientProperties.subClientEntity.appName
'clientInstanceName' = $subClient.subClientProperties.subClientEntity.instanceName
'vmContents' = $subClient.subClientProperties.vmContent.children.displayName -join "`n"
'vmFilters' = $subClient.subClientProperties.vmFilter.children.displayName -join "`n"
'vmDiskFilters' = $subClient.subClientProperties.vmDiskFilter.filters.filter -join "`n"
'proxyClient' = $subClient.subClientProperties.proxyClient.clientName
'backupPlan' = $subClient.subClientProperties.planEntity.planName
'vmTotalCount' = $subClient.subClientProperties.vmBackupinfo.vmTotalCount
'vmProtectedCount' = $subClient.subClientProperties.vmBackupinfo.vmProtectedCount
'vmPendingCount' = $subClient.subClientProperties.vmBackupinfo.vmPendingCount
'vmNeverBackedUpCount' = $subClient.subClientProperties.vmBackupinfo.vmNeverBackedUpCount
'vmBackedUpWithErrorCount' = $subClient.subClientProperties.vmBackupinfo.vmBackedUpWithErrorCount
'vmExcludedFromSLA' = $subClient.subClientProperties.vmSLAInfo.vmExcludedCount
'vmMetSLACount' = $subClient.subClientProperties.vmSLAInfo.vmMetSLACount
'vmMissedSLACount' = $subClient.subClientProperties.vmSLAInfo.vmMissedSLACount
'lastBackupJonbId' = $subClient.subClientProperties.commonproperties.lastBackupJobInfo.JobId
'lastBackupEndTime' = (Get-Date 01.01.1970)+([System.TimeSpan]::FromSeconds($subClient.subClientProperties.commonproperties.lastBackupJobInfo.endtime.time))
'fsContent' = $subClient.subClientProperties.content.path -join "`n"
}
$subClientObjs += $subClientObj
}
}
Get-Date