BookmarkSubscribeRSS Feed

Start/Stop all SAS Services in Windows using PowerShell

Started ‎12-05-2021 by
Modified ‎12-06-2021 by
Views 5,269

Inspired by the past post, I have created a script for starting/stopping SAS services in Windows using PowerShell.

 

The script identifies the SAS services and sorts them by configuration, level, and service start order to create the start and stop order. If you want to change the startup order, you can change the numbers in the script that indicate the sort order. I have made this script to work with as little configuration as possible. The script is simple enough that you can modify it to suit your particular environment.

sas-servers.ps1sas-servers.ps1

 

The script can be modified to add services to be captured and to modify the order of startup by modifying the following part. You can see how the script calculates the order of service startup by setting the $debug variable to $true and displaying the contents of the sort key.

order.png

 

You can download the script from the attachment.

Comments

Thank you, this is wonderful. I had considered trying to write something similar myself. I don't think my Powershell skills are up to this level, but what would be good in this would be:

1. To make it work across a multi-server environment (we have a metadata server, a mid-tier, a compute server and a LASR compute server)

2. To ensure webapp servers don't start until any upon which they are dependent have completely started (eg. 2_1 and 12_1 don't start until 1_1 is fully running).

 

I do rather love Powershell. And this is from someone who was dragged kicking and screaming from a Unix environment to Windows, about ten years ago!

Version history
Last update:
‎12-06-2021 07:29 AM
Updated by:

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags