Community

Subscribe
Highlighted
Accepted Solution

Using Powershell to set Multiple autosupport.partner.to addresses.

I'm having an issue trying to set the autosupport.partner.to with multiple addresses.

I got it to work properly on an older (FAS2050 with OnTap 7.3.7) by doing this:

$partner = get-content C:\scripts\Powershell\content\partners.txt

set-naoption autosupport.partner.to $partner

The partners.txt has 2 email addresses.

However when I try it on my new FAS6240 (OnTap 8.1.2 7mode) I keep getting this error:

Set-NaOption : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'OptionValue'. Specified method is not supported.

At line:1 char:37

+ set-naoption autosupport.partner.to autosupport@cstor.com, dl-desses@cstor.com

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidArgument: (Smiley Happy [Set-NaOption], ParameterBindingException

+ FullyQualifiedErrorId : CannotConvertArgument,DataONTAP.PowerShell.SDK.Cmdlets.Options.SetNaOption





Re: Using Powershell to set Multiple autosupport.partner.to addresses.

i would probably go at it differently.  When you read stuff into a file it becomes in array that you would iterate through.  This doesn't seem the right case for it

It's easy to do something like

$partners = "autosupport@cstore.com,dl-desses@cstor.com"

  set-naoption autosupport.partner.to $partners

Re: Using Powershell to set Multiple autosupport.partner.to addresses.

If I dropped the Variable and just did this:

set-naoption autosupport.partner.to "autosupport@cstor.com,dl-desses@cstor.com"

I get an error stating that it was unable to set the autosupport.partner.to option, however It works like a champ. The option is set and autosupport messages are going to all recipients.

Thanks for the help!!!!!!!!!!!!

Re: Using Powershell to set Multiple autosupport.partner.to addresses.

That happens when you call set-naoption autosupport.doit to something too. I think that api has an issue. Just call it with -erroraction silentlycontinue to suppress the error.

Connected by DROID on Verizon Wireless