0

Iam trying to generate sharepoint 2010 log file by command line Merge-SPLogFile.

But when i launch management shell it shows

The local farm is not accessible. Cmdlets with FeatureDependencyId are not regis tered.

I tried Merge-SPLogFile

PS C:\Users\Administrator> Merge-SPLogFile -Path F:\SPLogs Merge-SPLogFile : Microsoft SharePoint is not supported with version 4.0.30319.34209 of the Microsoft .Net Runtime. At line:1 char:1 + Merge-SPLogFile -Path F:\SPLogs + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (Microsoft.Share...letMergeLogFile: SPCmdletMergeLogFile) [Merge-SPLogFile], PlatformNotSupportedException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMergeLog File

PS C:\Users\Administrator> Merge-SPLogFile

cmdlet Merge-SPLogFile at command pipeline position 1 Supply values for the following parameters: Path: F:\SPLogs Merge-SPLogFile : Microsoft SharePoint is not supported with version 4.0.30319.34209 of the Microsoft .Net Runtime. At line:1 char:1 + Merge-SPLogFile + ~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (Microsoft.Share...letMergeLogFile: SPCmdletMergeLogFile) [Merge-SPLogFile], PlatformNotSupportedException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMergeLog File

PS C:\Users\Administrator>

Do i need to update .Net Runtime on this machine?

1 Answer 1

0

You need to add -Version 2 to your SharePoint Management Shell command line in the shortcut. This will force PowerShell to use .NET 2.0.

SharePoint 2010 Management Shell does not load with Windows PowerShell 3.0

7
  • Does this work ? Merge-SPLogFile -Path F:\SPLogs -Version 2 Apr 13, 2016 at 16:46
  • No, read the article I linked. You need to modify your shortcut.
    – user6024
    Apr 13, 2016 at 16:47
  • Its working after changing root from properties. i do have enough permisions on folder but it still says "PS C:\Users\Administrator> Merge-SPLogFile -Path F:\SPLogs Merge-SPLogFile : Access to the path 'F:\SPLogs' is denied. At line:1 char:16 + Merge-SPLogFile <<<< -Path F:\SPLogs + CategoryInfo : InvalidData: (Microsoft.Share...letMergeLogFile: SPCmdletMergeLogFile) [Merge-SPLogFile], UnauthorizedAccessException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMergeLog File PS C:\Users\Administrator>" Apr 13, 2016 at 16:52
  • Make sure you're running the SharePoint Management Shell as Administrator. Make sure you actually do have access to F:\SPLogs by navigating there with Windows Explorer on the local machine.
    – user6024
    Apr 13, 2016 at 16:53
  • Tried that too but no luck :/ Apr 13, 2016 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.