Monday, August 11, 2014

Windows Server 2012: Start / Stop Services With PowerShell

How can someone start or stop Windows Services with PowerShell? In my case I needed to start / stop SharePoint 2010 / 2013 Services.

To stop services use something on the line of this:

With $services I just create a simple array, which I will use in my foreach. Stop-Service simply stops the service I want to stop. I will also pause the script with .WaitForStatus() until the service reached a certain status, which is "Stopped" in this example.

To start services, it's the same, except that the status changed:

Edit 08/13/14: Had to update the scripts.

Tuesday, August 5, 2014

SharePoint 2010: Designer Workflows won't start

I don't like Sharepoint Designer Workflows, so I never really used them. Lately I had to and it ended in a lot of growing hatred, tears and curses. Boy, do I not like SharePoint Designer. I was finishing up a project and tried to test my Workflows just one more time. They were supposed to start if an item is created. They did not.

What happend? Designer Workflows won't start if you're creating an item as a Farm Administrator or as a System Account in general. At least that's how it seems. Just use a second account and you are good to go.

Is this a normal behavior?