Not able to get data remotely from SharePoint cmdlets Get-SPWebApplication and Get-SPContentDatabase

Hi,

I have a SharePoint Farm setup, having 3 servers with SharePoint 2013 installed and a database server separate. I was trying to get data from all the servers using power shell remotely. I have already done following steps:

  • Enabled PSRemoting.
  • Followed steps to give user required privileges using Add-SPShellAdmin
  • Using CredSSP authentication for remotely connecting using PowerShell.
  • Added PSSnapin for SharePoint.

Now I am able to get data for Get-SPTimerJob and Get-SPServiceInstance but when I am trying to execute Get-SPWebApplication or Get-SPContentDatabase cmdlets then it is hanging forever and not returning any data or throwing any error. Someone please tell if I am missing some permissions or anything else and/or suggest any other solution [any other cmdlet to get similar data, etc.]. Also, please tell how can I log the errors or problems if it is throwing any but I am not able to see.

Its very urgent for my monitoring purpose. Thanks in advance.

September 8th, 2015 5:46am

Could be a memory issue - Worth to execute the below code and give a try

Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 6:30am

Why do you want to enable remoting and monitor SharePoint farm from your local machine? Any specific business requirement?
September 8th, 2015 6:34am

I tried that too, I have even increased to 2048MB still the same issue.
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 6:56am

I am trying to create a PS script to monitor SharePoint Farm for developing a product for my company.
September 8th, 2015 7:01am

Then I advice you to use CSOM in PowerShell - PowerShell remoting for SharePoint is not really very friendly or a good move

You need to work on code - the example for using CSOM is below

http://social.technet.microsoft.com/wiki/contents/articles/29518.csom-sharepoint-powershell-reference-and-example-codes.aspx

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 7:07am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics