Category Archives: PowerShell

Usage and Health Data Collection Service Proxy Stopped

Sometimes you notice that under the Service Applications which are provisioned one of them is stopped. If that’s the case you have to restart them via PowerShell. The Usage and Health Data collection Service Proxy is stopped almost certain after provisioning and sometimes just to be spontaneous. It’s an unfortunate known bug.

 The PowerShell Script below will help you restart the Service Application.  

  1. Open PowerShell and Add the SharePoint Snapin.
    Add-PSSnapin-Microsoft.SharePoint.Powershell
  2. Get-ServiceApplicationProxy
    This will give you a whole list of Service Applications.
    Get-SPServiceApplicationProxy | where {$_.TypeName -like “Usage*”}
    This will only give you the Usage Data Collection Service Proxy because your filtering on one starting with the word “Usage*”
  3. Double click on the ID number and copy it to an empty notepad file.
  4. Copy the script below and replace the part with the ID you just copied.
    $UP = Get-SPServiceApplicationProxy | Where {$_.ID -eq “Paste ID Here”}
    $UP.Provision()

Now if you refresh the page with your published Service Applications in Central Admin the SA is Started.

 


Unable to display Excel workbook after configuring the SSA

Sometimes it can happen you configure the SharePoint Service Application for Excel Services and when you add the web part to show a Excel workbook you get a nice friendly error message about authorizations and all.

The reason for that is that the Application Pool account from the Excel Service SSA doesn’t have any authorisations on the web applications your trying to use it in.

The PowerShel script below will fix this. Just change the url in the one from your site collection. 

$webApp = Get-SPWebApplication “http://UrlSiteCollection
$webApp.GrantAccessToProcessIdentity(“DOMAIN\SPexcelSSA_Pool”)

 


Run as an Administrator

 

And then people dare to say administrators a lazy people :+)

For some programs it’s essential that if you use them you are in Administrator mode, for instance PowerShell or Visual Studio. Just because we admins are humans, special once of course we tend to forget things to from time till time and to make sure we don’t need to remember everything we got these little tricks.

Just to make sure you always run the program as an administrator choose properties of the shortcut and choose the compatibility tab. Nearby the bottom you find Priveledge level and a nice option Run this program as an administrator with a checkbox beside it. Mark it and from now on you don’t have to remember.

 

 

 

 

 

 


Install-SPSolution error “Admin SVC must be running in order to create deployment timer job”

Last night I was installing a solution on my own farm at home and because I turn my server off sometimes You get the usual errors to get everything up and running. But so far no problems until I wanted to install a solution package from my Web Frontend server. I opened PowerShell and added the SharePoint snapin.

I added the solution file Add-SPSolution “C:\MySharePointSolution.wsp“ and then I installed it Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment -Force.

Only at the installing part I got a nice red PowerHell error, “Admin SVC must be running in order to create deployment timer job”.

After inspecting the error message I was thinking, WTF is the Admin SVC ?, So I turned to our trusty friends of BING (yes in some post I use Google and some BING, please don’t tell anybody but I’m a secret double agent). But Any way, the Admin SVC is actually the SharePoint 2010 Administration service (Windows Service – services.msc).

After starting the service and giving the Install-SPSolution command one more hit everything worked like a dream.


PowerShell Install-SPSolution trouble

Hey People,

A moment ago I deployed a solution with PowerShell and I’ve received a weird error. Atleased not weired but it did not made me happy. This is what I did,

  • Add-PSSsnapin Microsoft.SharePoint.PowerShell
  • Add-SPSolution “C:\MySharePointSolution.wsp
  • Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment

Then I did, Get-Solution and I saw my newly installed sollution was False. In de Central Admin Console I found an error.

SERVERNAME : Failed to create receiver object from assembly “MySharePointSolution, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXX”, class “SomeNamespace.Features.Lists.ListsEventReceiver” for feature “SomeNamespace_Lists” (ID: {GUID}).: System.ArgumentNullException: Value cannot be null.

First I checked all the SharePoint Windows Timer Services if they where running and yes this was the case.

Then somebody on the web pointed out just to stop and start the timer service of the WFE servers because of a DLL that would be cached and causing trouble. So I stopped and started the Timer service and deployed it again. Only this time I’ve got an other error that there already was a solution. SharePoint suggested to add -Force and that was the trick, it worked like a dream.

So in the end of this story the clue is resetting services can do magic.