Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I just installed SharePoint 2013 Foundation on a server. I'm confused as to how I can access the PowerShell cmdlets from my client pc. Everything I read assumes you're in front of the actual server. Is there anything like an RSAT module I can install on my client PC?

I don't want to use psremoting, because that has some limitations (I have a lot of custom modules loaded on my client pc). Is there really nothing like say the AD, DNS, DHCP, etc. PowerShell modules, but for SharePoint?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You have to be either on the sharepoint server, or use the PSSession module (PSRemote)

New-PSSession -ComputerName SP2013Server

Then add:

Add-PSSnapin Microsoft.SharePoint.Powershell
share|improve this answer
    
Booo is that really the only way? They have a management shell for Sharepoint Online which looks like what I want, but this is an in house installation (technet.microsoft.com/en-us/library/fp161362(v=office.15).aspx). I'm surprised they have this for the cloud offering, but not in house- or maybe I'm not misunderstanding something? –  user1028270 May 27 at 16:44
3  
Nope, that's the way it is. Probably for security reasons, but I agree the parts available in the Online shell could be available for client in on prem as well –  Robert Lindgren May 27 at 16:46
    
Oh well thanks for clarifying that for me anyway. –  user1028270 May 27 at 17:15

Instead of using PowerShell Remoting with SharePoint you could consider another approach.

Since SharePoint 2013 supports several sets of APIs, you could utilize client APIs (CSOM/REST) in PowerShell.

As you already mentioned Microsoft released Windows PowerShell for SharePoint Online for working with SharePoint Online. This SDK uses CSOM as the underlying API for SharePoint Online cmdlets.

To summarize, instead of using PowerShell based on Server Side Object Model (SSOM), it is proposed to perform an operations using client APIs (CSOM/REST) in PowerShell

Example

Get-SPFeature cmdlet returns the SharePoint Features, for example:

Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "SITE"}

The CSOM version:

$context = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$siteFeatures = $context.Site.Features 
$context.Load($siteFeatures) 
$context.ExecuteQuery()

The REST version:

$Url = "https://tenant.sharepoint.com/_api/site/features"
$data = Invoke-RestSPO $Url Get $UserName $Password

Invoke-RestSPO is a custom cmdlet, follow this post for a details.

References

share|improve this answer
1  
Nice alternative approach! –  Robert Lindgren May 27 at 21:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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