Data Backup and Recovery Discussions

PowerShell Command to Edit Resource Group in SnapCenter



I have 59 Resource Groups and need to change the email notification settings on all of them (specifically the EmailTo field). I am looking in PowerShell and found the commands Set-SmProtectResource and Set-SmResourceGroup, but neither command (from what I can tell) lets you edit the EmailTo field, which is the one I need to change on all 59 groups. Obviously I'm changing the global setting too, but (if I understand correctly) that only affects the next resource groups I create.


Am I missing something in these two commands that would allow me to do what I need to do? Would love any tips or suggestions! Thank you.


Re: PowerShell Command to Edit Resource Group in SnapCenter


You should be able to perform the task using the command  Set-SmProtectResource and Set-SmResourceGroup by using the -EnableEmail parameter ( no value need to be added; you will be prompted to enter the settings once you hit Enter).

Below is an example of what to expect when running the command:

PS C:\Users\Administrator.DEMO> Set-SmResourceGroup -ResourceGroupName <> -PluginCode <> -Resources @{"Host"="";"Type"="SQL Database";"Names"="<>"} -EnableEmail

cmdlet Set-SmResourceGroup at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)


Not sure which Snapcenter version you have but below is the powershell reference guide, or you can use the help command:


To see the examples, type: "get-help Set-SmResourceGroup -examples".
For more information, type: "get-help Set-SmResourceGroup -detailed".
For technical information, type: "get-help Set-SmResourceGroup -full".


View solution in original post

Re: PowerShell Command to Edit Resource Group in SnapCenter


Thank you @hmoubara ! I was actually given some mySQL commands that did the trick, but this is more straightforward. I did not realize it would prompt for settings. Thanks again!

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums