Record/Compair Autosupport Settings for many controllers

by New Contributor on ‎2012-02-23 10:40 AM

This is a followup to a post listed here which shows how to check two controllers against eachother to make sure the Autosupport settings match, and offers how to fix them, or can automatically fix them. This script is designed for those of us who have to manage a large farm of controllers, and have a known good controller that is perfect. This also helps site that want to enforce change control to make sure that settings dont change. Since many controllers are hard to compair on a PowerShell output screen, this tool exports the data to Excel. This also can be used/saved for future reference.

Script is as follows.

# This script will connect to a Storage Controller and retreive all
# of the AutoSupport Setttings. It will then connect to a second
# controller and compair those settings. The recommended changes will be shown.
# script now assumes an working controller that is set up correctly.
# it then points to a list of other controllers and lets you know if any of them differ

$workingController = ""
$targetControllers= @("","","")
$User = "root"
$Pass = "Password1"

$WCPass  = ConvertTo-SecureString $Pass -AsPlainText –Force
$Wcred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$WCPass
$TCPass  = ConvertTo-SecureString $Pass -AsPlainText –Force
$Tcred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$WCPass
$workops=new-object system.collections.arraylist
Connect-NaController $TargetController -Credential $Tcred

$suppress = $Targops = get-naoption autosupport.*
Write-host "------------------------------------------------"

$excel=new-object -comobject excel.application

$worksheet.cells.item(1,1)="Option Name"
$worksheet.cells.item(2,1)="Controller Name"
$worksheet.cells.item(1,2)="Master FAS"
foreach($Controller in $TargetControllers)

{          Connect-NaController $Controller -Credential $Wcred
          $Workops.add( (get-naoption autosupport.* ) )
           $worksheet.cells.item(1,$cellr)="Target FAS"
$worksheet.cells.item(1,$cellr)="Command to fix"

Write-host "------------------------------------------------"
foreach ($workop in $workops)
{     $coun=$coun+1
      foreach ($item in $workop)
      {      $workname=$
            $workval =$item.value
            foreach($titem in $targops)
            {     if ($ -eq $
                  {      $line=$line+1
                        write-host "   "$"="$item.value    
                        if ($titem.value -ne $item.value)
                        {      write-host "   "$"="$item.value" -Values Mismatch ="$titem.value
                              $worksheet.cells.item($line,$cellr)=("set-naoption"+$" "+$item.value)
                              write-host "        To fix this issue, command is as follows;"
                              write-host "           set-naoption"$""$item.value
$workdoc.EntireColumn.Autofit() | out-null

The output from this script looks as follows.


Hi Chris,

This is a real good for us to compare options on our filers, I changed the older script in part 5 to show all filer options and created a server array instead of just the autosupport* like this:

$Workops = get-naoption (so it would display all options)

I tried to changed this new script to do the same thing so we could have it output to excel but it doesnt work like the script in Part 5, do you have any ideas on this? Also have the excel file saved to a disk so we can run it as a script and email it out would be nice.

Ok I figured it our powershell needed a reset, Thanks for this

Hi chris

Ive managed to get all the options but I would like it to save to file rather than pop up on screen any ideas?

as its will run a as a scheduled task


Ok Managed to get it to save the file too so it emails the admins:


Hopefully will be useful

Ive just realised the output for the master controller settings is not correct and cannot see connection to the master controller in the script, is anyone else using this script or know how to fix it?

The settings of the master controller seem to be the same as the target controllers

Any ideas or fixes please?


thanks for nice script,

I am trying to create a script for Filer initial perametrs configuration such as IP,Hostname,etc..

I have a DHCP server enabled in my enviornment,So when I power on a new Controller ,The dhcp will assign a IP to the filer.

Is there any possibility for that?


why dont you bung the config into an rc file so it will load on boot use vi through unix or cifs to edit the rc file





etc etc

Is it possible to create it for multiple filers?My intention is to fully automate the Provision of a new filer

yep what your trying to do is achievable with this ssh wrapper you'll have to script it with ssh, obviously secureadmin will have to be run with keys etc before you execute your setup script with this wrapper

im sure you can do it in powershell too which might be easier as its keyless

This is very nice and helpful.. How hard to modify or make it to work with clustermode ?

Saluting Chris,

Love your wonder script:>)

Thanks & Happy Thursday



This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.