cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5894
Views
10
Helpful
4
Comments
joemar
Level 4
Level 4

This PowerShell/PowerTool script will log into UCSM and generate an Excel spreadsheet of all your Service Profiles that have vHBAs associated with them.  The spreadsheet will contain your Service Profiles, WWPNs for the A and B fabric and the WWNN.

The script will work with Service Profiles that have two vHBAs (Fabric A and B) or a single vHBA on either the A or B fabric.  It will not support systems where you have a mix of the above.

I created this script for my customers so they could provide their SAN administrator a list of WWPNs for doing zoning and initiator groups during the creation of LUNs.

The script requires that the client machine be running PowerShell, PowerTool and Excel.  The client must also have a UCSM login and be on a network that has access to UCSM.

Change Log:

     v0.3 - Initial Posted Version

     v0.4 - New look and feel and common script design

     v0.4.01 - Added built in help.  Command line options.  Standard naming convention.

     v0.4.02 - Added support for saved credentials file

As always, please let me know if you have questions, problems or suggestions for the script.

Joe

Comments
bala rangaraj
Level 1
Level 1

Hi Joe,

I am new to powershell ,Please help with steps to get the details.

Regards,

Bala

joemar
Level 4
Level 4

Bala,

PowerShell is a Microsoft scripting language.  Thus it must be run from a Windows Machines.  My scripts are written to support PowerShell v3 and above so you'll need to run Windows 7 or above for a client OS or Server 2008R2 or above for a server instance to be able to get V3.  You will also need to download and install the Cisco PowerTool PowerShell library for UCS.  That can be downloaded from www.cisco.com under the downloads section by searching for PowerTool.  Download the latest.  The machine to run the script from must have network access to your UCS system(s).  Once you have that setup you will need to enable PowerShell on your workstation/server where you are executing the script from and have installed PowerTool.  To do this open a PowerShell window and enter: set-executionpolicy unrestricted -force.  Now you can run PowerShell scripts.  Download the Get-UcsWwpn script from communities, extract it into a folder of your choice and then go to that folder and execute it by entering .\get-ucswwpn.ps1 and press enter.  Follow the information and prompts from the script and it will generate the file of the WWPNs for you.  This particular script requires Excel to also be installed on the machine where you are running the script.  You will see any pre-req's in the script as you execute it.

Beyond that I would suggest doing some searching on the Internet for search items like "introduction to powershell" and "learning powershell" to learn more.

ipstack
Community Member

joemar

Question: I keep getting:

Script Running...

This script allows you to log into a UCSM domain and it will collect all of the

WWPNs and WWNNs for each created Service Profile in the UCS Domain and write that

information to an Excel document.

This script requires Excel, PowerTool, PowerShell v3 or above and network access to your UCS

This script supports configurations with dual vHBAs, single vHBAs on either the A or B fabric

but it does NOT support a solution where you mix these. ie: Some have dual and some have one.

Set-Location : Cannot process argument because the value of argument "path" is null. Change the value of argument "path

" to a non-null value.

At C:\Users\misic71\Desktop\UCS_Scripts\Get-UcsWwpn.ps1:85 char:3

+ cd <<<<  $PSScriptRoot

    + CategoryInfo          : InvalidArgument: (:) [Set-Location], PSArgumentNullException

    + FullyQualifiedErrorId : ArgumentNull,Microsoft.PowerShell.Commands.SetLocationCommand

Thoughts?

joemar
Level 4
Level 4

Ronald, sorry for my late reply.  I'm just back from a 3 month leave.  Did you get this figured out?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links