Cloud Articles and Resources

Powershell Commands for OnSite Support Activities : Part 2 of Troubleshooting Tools


This script came about when I realized that the guy managing the servers owned the switches (see UCS), and he wanted to do all of the zoning as well as all of the SAN design. Well, have at it, but he needed to quickly know what the World Wide Names were that were associated with each array, and what to call those Arrays so they could create appropriate aliases and zones. What follows is just the information that the person owning the switches needs to know about the array to accomplish those jobs. You could easily create a wrapper for each loop that walks through a set of controllers, or interrogates your whole enviornment. At the end of this series I will show you how to wrap all of the commands together and run them against a set of controllers instead of a single controller.

Also note that this script assumes you have already used the connect-nacontroller to open the communications link to the array.

The Sample output of this script is as follows.

PS C:\software\toolkit> .\filertargetports.ps1

-System Name               =  2040top
-System Model               =  FAS2040
-System Serial Number     =  700000251978
-System OS                    =  NetApp Release 8.0 7-Mode: Thu Mar 11 16:10:16 PST 2010
-Target list----------------------------
      Array Physical port 0a is WWPN 50:0a:09:81:98:7d:2e:52 and is online
      Array Physical port 0b is WWPN 50:0a:09:82:98:7d:2e:52 and is link disconnected

PS C:\software\toolkit>

The script is as follows.

# This script outputs in simple Language the Ports that exist on the Filer
# These match up to the ports on the back of the device.
# assume that you have already connected to the array you want to ingerrogate

$x = get-nafcpadapter
$y = get-nasysteminfo
$z = get-nasystemversion

write-host ""
write-host "-System Name          = "$y.systemname
Write-host "-System Model         = "$y.SystemModel
Write-host "-System Serial Number = "$y.systemSerialNumber
Write-host "-System OS            = "$z
write-host "-Target list----------------------------"
foreach ($port in $x)

  write-host " Array Physical port"$port.adapter "is WWPN"$port.portname"and is"$port.state
write-host "----------------------------------------"

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with 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 (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

All Community Forums