Microsoft Virtualization Discussions

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

jjd003166
4,040 Views

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: (:) [Set-NaOption], ParameterBindingException

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

1 ACCEPTED SOLUTION

JGPSHNTAP
4,040 Views

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

View solution in original post

3 REPLIES 3

JGPSHNTAP
4,041 Views

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

jjd003166
4,040 Views

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!!!!!!!!!!!!

bsti
4,040 Views

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

Public