C-Mode Visio Generator PowerShell Script Module.

This Function is based on the script created by Marc Hofstetter " https://communities.netapp.com/docs/DOC-14260"  

 

I modified the Script into a powershell module also added the below functionalities

 

Appended Funtionality of Displaying LUNS bounded to Flex Vols.

Appended Funtionality of Displaying LUNS/Aggregates/Volumes TotalSize/AvailableSize.

Appended Funtionality to display Controller Model Number.

 

  • Once the Script Creates Visio Right click on the Controller Object and Click "Show Shape Text" to see the controller model number, by default The UML message shape's text is protected

 

The Script Module's Functionality has been verfied with VISIO 2007.

 

How to run the module

 

a) Download The attached OntapVisio.psm1 file to your desktop

 

b) Import The Module, Use The usual Get-Command -module OntapVisio to see the list of cmdlets available, similarly type Get-Command <cmdletname> -detailed to see detailed help, -examples to get examples

 

Import-Module "C:\Users\Vinith\Desktop\OntapVisio.psm1"

 

Get-Help Show-CModeVisio -Detailed

 

Get-Help Show-CModeVisio -Examples

 

 

 

d) Run the Cmdlet against a filer and get the visio generated.

 

Show-CModeVisio -Controller <C-Mode Cluster FQDN> -UserName <C-Mode Cluster UserName> -Password <C-Mode Cluster Password>

 

 

e) You can get Visio Diagrams of Multiple C-Mode Controllers which all have a common password by piping the list of all c-mode controllers (saved in a .txt file) to this cmdlet.

 

 

Get-Content "c:\clusternamelist.txt" |  ForEach-Object { Show-CModeVisio -Controller $_ -UserName admin -Password admin@123 }

Comments

Works in Visio 2010. If you are getting a "File Not Found error" it is due to the stencil locations on the computer and the script needs to reflect the proper path. I changed the script a little bit

$shpFile1 = "\NetApp-Logic-Icons.vss"

$shpFile2 = "\NetApp-Equipment-Icons.vss"

$shpFile3 = "\NetApp-Icons-2.vss"

$shpFile4 = "\NetApp-Essentials.vss"

and then changed this line to

$stnPath = "C:\Users\userid\Documents\My Shapes"

Hi i was curious if this is still being developed or tweaked etc?

 

Attempted this with visio 2013 and i get a ton of errors. but the 7 mode version works fine. Using the version 3.2.1 of the toolkit. I have also tried this with the older versions - worked for 7 mode but not cmode. When i say 7 mode I mean the posh script for 7 mode visio diagram

 

snippet of errors:

 

Adding LUN Name: /vol/cv2/cv2.lun
TotalSize(GB): 4,301.02
Exception calling "Drop" with "3" argument(s): "
An exception occurred."
At C:\Scripts\OntapVisio.psm1:65 char:11
+ $shpObj = $pagObj.Drop($mastObj, $x, $y)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Smiley Happy [], MethodInvocationException
+ FullyQualifiedErrorId : COMException

The property 'Text' cannot be found on this object. Verify that the property exists and can be set.
At C:\Scripts\OntapVisio.psm1:67 char:11
+ $shpObj.Text = $item
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Smiley Happy [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At C:\Scripts\OntapVisio.psm1:55 char:5
+ $connectBegin = $shpConn.CellsU("BeginX").GlueTo($firstObj.CellsU("PinX"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Smiley Happy [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Scripts\OntapVisio.psm1:57 char:5
+ $connectEnd = $shpConn.CellsU("EndX").GlueTo($secondObj.CellsU("PinX"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Smiley Happy [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull