Data Backup and Recovery

PowerShell Command to Edit Resource Group in SnapCenter

TMADOCTHOMAS
2,764 Views

Hello,

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.

1 ACCEPTED SOLUTION

hmoubara
2,633 Views

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"="SQLQA.demo.netapp.com";"Type"="SQL Database";"Names"="<>"} -EnableEmail

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

 

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

 

https://library.netapp.com/ecm/ecm_download_file/ECMLP2857409

 

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

2 REPLIES 2

hmoubara
2,634 Views

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"="SQLQA.demo.netapp.com";"Type"="SQL Database";"Names"="<>"} -EnableEmail

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

 

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

 

https://library.netapp.com/ecm/ecm_download_file/ECMLP2857409

 

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".

 

TMADOCTHOMAS
2,622 Views

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!

Public