2

I am trying to get the Page URL visits which we get from Experience Analytics dashboard using Powershell. Below screenshot specifies the data i am trying to access using Powershell. enter image description here

I found a link where the data from xDB is retrieved using Powershell. Link: https://jockstothecore.com/xdb-reports-with-powershell/

But on executing as specified in the Link, i am getting below errors:

Add-Type : c:\Windows\Temp\g0dqtof0.0.cs(3) : Using the generic type 'MongoDB.Driver.Builders' requires 1 type arguments

c:\Windows\Temp\g0dqtof0.0.cs(2) :     using MongoDB.Driver;

c:\Windows\Temp\g0dqtof0.0.cs(3) : >>>     using MongoDB.Driver.Builders;

c:\Windows\Temp\g0dqtof0.0.cs(4) :     using Sitecore.Analytics.Model;

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 '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

I have verified that the Assemblies are present in my Bin folder. Can someone help me with this issues. or is there any other way to complete my requirement ?

  • Do you run this command from windows powershell or from Sitecore Powershell Extensions? – Marek Musielak Sep 6 at 6:20
  • @MarekMusielak, I am running through Sitecore Powershell Extension – Vinay Sankar Sep 6 at 6:35
  • What version of Sitecore you are using? – Mahendra Shekhawat Sep 6 at 7:23
  • @MahendraShekhawat We are Using 8.2 version (Update-5) – Vinay Sankar Sep 6 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.