kimo pryvt
kimo pryvt

Reputation: 503

Export COM object or convert to XML

I need to export the output of the Fsrm.FsrmQuotaManagerEX COM object to an .XML. I have created this script that gets me the source template name and the path for each configured quota in the server.

$cuotaInfo = New-Object -com Fsrm.FsrmQuotaManagerex
$cuotaInfo.enumcuotas()| select SourceTemplatesName,Path

Output of the command in Windows server 2008: Output of the command in Windows server 2008

I am trying to pipe the output with the cmdlets Export-CliXml and Export-Csv but I am getting this error:

enter image description here

Any ideas about how to export the output to a manageable file like .xml or .csv?

Upvotes: 0

Views: 143

Answers (1)

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200453

The error message you posted clearly says that the type Fsrm.FsrmQuotaManagerex isn't recognized. Not really surprising when the class name is actually Fsrm.FsrmQuotaManager, not Fsrm.FsrmQuotaManagerex.

PS C:\> $qm = New-Object -COM Fsrm.FsrmQuotaManagerex
New-Object : Retrieving the COM class factory for component with CLSID
{00000000-0000-0000-0000-000000000000} failed due to the following error:
80040154 Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)).
At line:1 char:7
+ $qm = New-Object -COM Fsrm.FsrmQuotaManagerex
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMException
    + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Comman...

PS C:\> $qm = New-Object -COM Fsrm.FsrmQuotaManager
PS C:\> $qm.GetType().FullName
System.__ComObject

Upvotes: 1

Related Questions