Unable to get xDB reports using Sitecore Powershell

106 Views Asked by At

I am trying to get the Page URL visits which we get from Experience Analytics dashboard using Powershell. But unable to achieve that.

Trying to get the below data in Experience Analytics through Powershell: Data

I found a link where the data from xDB is retrieved using Powershell. I have tried steps mentioned in that Link but getting errors.

Getting below errors on using the code provided in link: Errors

Add-Type : c:\Windows\Temp\g0dqtof0.0.cs(11) : The type or namespace name 'IMongoQuery' could not be found (are you missing a using directive or an assembly reference?)

c:\Windows\Temp\g0dqtof0.0.cs(10) :     {

c:\Windows\Temp\g0dqtof0.0.cs(11) : >>>         public static MongoCursor QueryVisits(MongoDbDriver driver, IMongoQuery query)

c:\Windows\Temp\g0dqtof0.0.cs(12) :         {

At F:\Inetpub\Website\temp\tmp3CB4.ps1:1 char:1
+ Add-Type @'
+ ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError) [Add-Type], Exception
    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : c:\Windows\Temp\g0dqtof0.0.cs(11) : The type or namespace name 'MongoCursor' could not be found (are you missing a using directive or an assembly reference?)

c:\Windows\Temp\g0dqtof0.0.cs(10) :     {

c:\Windows\Temp\g0dqtof0.0.cs(11) : >>>         public static MongoCursor QueryVisits(MongoDbDriver driver, IMongoQuery query)

c:\Windows\Temp\g0dqtof0.0.cs(12) :         {

At F:\Inetpub\Website\temp\tmp3CB4.ps1:1 char:1
+ Add-Type @'
+ ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError) [Add-Type], Exception
    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : Cannot add type. Compilation errors occurred.
At F:\Inetpub\Website\temp\tmp3CB4.ps1:1 char:1
+ Add-Type @'
+ ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Add-Type], InvalidOperationException
    + FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand

Is there any other way to get the xDB data using Sitecore Powershell extensions?

0

There are 0 best solutions below