To all,
I'm sharing a powershell script that may be useful to those having to admin a SAS installation on Windows.
This script was created to automate the stop/start/restart/reboot of all, or chosen, SAS Services and Servers. Part of the idea behind the script was that it could be used by admins and non-admins alike. So a GUI based Menu that verifies config before running and which can't be accidentally run (for the non-admins), and the ability to run from the command prompt (for the admins).
The script uses a CSV file to specifiy the correct order to start/stop services (and optionally another CSV to archive/delete log files etc.) on the SAS servers. The script can also check the server.log and wait for the webservices to start before continuing.
EDIT> I was a bit pressed for time when I submitted the original post, so I'll add some additional details as to why this script may be of use and what it can do:
The SAS Startup order in the examples etc was gleaned from various sources but mostly from the official http://documentation.sas.com/?docsetId=bisag&docsetTarget=p0d9d5nzmd8i4yn1usv2l22vpa7t.htm&docsetVer... .
If you are going to use the Folder Archiving and deleting/cleanup (optional), make sure that your paths are correct, or you may end up deleting more than you bargained for. You can perform recursive deletes of entire directory structures. So. Be. Careful.
NOTE: This script was used on a SAS 9.4 M2 installation.
NOTE: At a minimum you must load a SAS Services Start Order config csv. Example files are in the Configuration_Files folder.
NOTE: You cannot run any Actions until the Check option is run.
NOTE: To reduce the risk of accidentally running the wrong action, an additional screen prompts a written confirmation of the action before continuing.
Example restart of SAS Services:
When prompted type RESTART or REBOOT to perform the chosen action. NOTE: The input is case sensitive.
I cannot test the script but this looks very useful, especially since SAS_lsm does not cover Windows. Thanks a lot for sharing with the community !
If you intend to maintain the script further along in the future, perhaps could you even share it from GitHub ?
thanks, I'm moving to a new job soon that doesn't involve SAS, so I won't be in a position to support the script. But if someone finds it useful and wants to extend/improve it... that's fine with me.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.