Showing posts with label TroubleShoot Sharepoint. Show all posts
Showing posts with label TroubleShoot Sharepoint. Show all posts

Monday, March 13, 2017

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered


Problem:
Recently I started facing this issue.
Whenever, I load the PowerShell ISE and Type the command to load the SharePoint PowerShell module, it starts throwing error

“The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.”
The same error comes up in the SharePoint Management Shell.

Solution:
You have someone who has the rights to run powershell add your user as SP Shell Admin.
Add-SPShellAdmin -username DOMAIN\YourUser

That's quite the nobrainer, but what happens if your user is already SPShellAdmin, shown with Get-SPShellAdmin and you get the same error popping up? In that case, something probably happened with the SQL. They restored the farm on another server and did not migrate all the access rights. Just run Add-SPShellAdmin -username DOMAIN\YourUser again and it will set the appropriate permissions.


Saturday, June 27, 2015

Bulit-in feature in Sharepoint for monitoring Sharepoint disk space usage


Types of SharePoint Log Events
  • Unified Logging System (ULS) 
  • Trace Logs 
  • Windows Event Logs 
  • Logging Database 
  • Health Analyzer 
  • Timer Jobs 


Unified Logging System (ULS) 

Eye for sharepoint and each event Report generating

We can see three ways:

  • SharePoint trace logs
  • Windows Event Log
  • SharePoint logging database

     Trace logs

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15
    The naming format for the trace log files is machinename-YYYYMMDD-HHMM.log, in 24-hour time.
     By default, a new log file is created every 30 minutes.
     You can change the interval by using Windows PowerShell with the Set-SPDiagosticConfig command. 
    The following powershell code snippet configures SharePoint to create a new trace log every 60 minutes.
    Set-SPDiagnosticConfig Set-SPDiagnosticConfig -LogCutInterval 60
    Get-SPDiagnosticConfig outputGet-Help set-SPDiagnosticConfig -ExamplesSet-SPDiagnosticConfig -LogLocation e:\Logs


    SharePoint LogLevel:
    Get-Command -Noun SPLogLevel

    Using SPLogEvent and SPLogFile:

    Get-SPLogEvent | Select -First 5
    Get-SPLogEvent | Select -Last 5
    Get-SPLogEvent | Select -First 20 -Last 10


    In Central Administration, click Monitoring on the left, and then select Configure Diagnostic Logging under the Reporting section
  • users reset logging Reset to default setting
Moving trace logs

Logging Database
  1. Search Queries
  2. Timer Jobs
  3. Feature Usage
  4. Content Import Usage
  5. Server Farm Health Data
  6. SQL blocked queries
  7. Site Inventory
  8. Search Query statistics
  9. Page Requests
  10. Site Inventory Usage
  11. Rating Usage
  12. Content Export Usage
  13. NT Events
  14. SQL high CPU/IO queries
  15. Search Crawl
  16. Query click-through

Powershell
get-command -noun spusage*
Set-SPUsageApplication -DatabaseServer <Database server name>
-DatabaseName <Database name> [-DatabaseUsername <User name>]

[-DatabasePassword <Password>] [-Verbose]
Health AnalyzerIn Central Administration, you click Monitoring and then select Health Analyzer.
Timer JobsGet-Command -noun SPTimerJob