There is a question posed on the Opalis forums right now where a user is attempting to run a script to backup the management packs from their SCOM server.
I’, trying to make a workflow in Opalis for backing up the management packs on my SCOM server – but without any luck.
First i tried making a .net script in Opalis which included the PS script to be run – but without any luck. Then I wanted to try saving following script on my SCOM server and running it localy:
Get-managementpack ¦ export-managementpack -path c:\BACKUPPATH
This worked without any problems, when running it localy. I then thought that it would be possible to share the script on the SCOM server and in my Run .NET script in my Opalis workflow point to the \\SCOMSERVER\SHARE\SCRIPT.PS1 and everything would be fine. But no. I get the following error.
File \\SCOMSERVER\SHARE\SCRIPT.PS1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details
What would be the best way of handling the backup of management packs? My idea is that the best way of handling this, would be having the while PS script in the Opalis .NET object, but I’m not quite sure how it is possible to get it working. Any ideas?
So, what I am going to do is create a policy that you can pass the below variables to and will run the script using the scheduled task engine to execute the script.
- Share Location: Location to store the script on
- Script Body: The body of the script
- Script Name: The Name of the script
- Script Parameters: Any parameters you would like to pass to the script
- Computer Name: Name of the computer to execute the script on
- Username: User Acct to run the script
- Password: Password for the user account
So we can now test this to make sure it works!