Visio using PowerCLI generate your vCenter Network Diagram

Visio using PowerCLI generate your vCenter Network Diagram

Visio using PowerCLI

In this blog post, i would be showing you a cool way using which you can generate a network map of your entire vmware infrastructure, it basically involves using powercli in conjunction with visio api calls to automatically generate a network diagram of your virtual infrastructure.

The script below needs a connectivity to a vCenter server, once established it would iterate across all the clusters in your environment and generate a visio for it and save it to a predefined destination location.

You would need to download the VMware EUC Visio Stencils 2015.vss stencils and save it in your visio shapes library.

In my setup i saved it in the “My Shapes” location as shown below in the screen capture.

test

Also note the script was tested in Visio 2013 and it worked flawless in generating the visio file.

Let me show a sample of how the Final completed Visio generated look’s like.

Visio using PowerCLI.

Visio using PowerCLI

Next let me walk you through the script itself.

First and foremost, you need to connect to the vCenter environment using

Connect-VIServer <Vcenter Server> -Credential (Get-Credential)

Next part of the script explanation is highlighted in the comments itself, so lets see its inner working. You can save it and reuse the code as per your environment, feel free to modify and add more content as the possibilities for this logic is endless.

# Get all Clusters
$allclusters = Get-Cluster

# Iterate for each cluster and generate and save the vCenter Network map visio diagram.
foreach ($cluster in $allclusters)

{


$shpFile1 = "VMware EUC Visio Stencils 2015.vss"
 
#VISIO Function for the Connection-of-objects  
function connect-visioobject ($firstObj, $secondObj)  
{  
    $shpConn = $pagObj.Drop($pagObj.Application.ConnectorToolDataObject, 0, 0)  
    #// Connect its Begin to the 'From' shape:  
    $connectBegin = $shpConn.CellsU("BeginX").GlueTo($firstObj.CellsU("PinX"))  
    #// Connect its End to the 'To' shape:  
    $connectEnd = $shpConn.CellsU("EndX").GlueTo($secondObj.CellsU("PinX"))  
}  
 
#VISIO Function for adding the object into the drawing  
function add-visioobject ($mastObj, $item)  
{  
         Write-Host "Adding $item"  
        # Drop the selected stencil on the active page, with the coordinates x, y  
          $shpObj = $pagObj.Drop($mastObj, $x, $y)  
        # Enter text for the object  
          $shpObj.Text = $item
        #Return the visioobject to be used  
        return $shpObj  
 }  
 
# Create VI Properties to extract vmtype

New-VIProperty -Name GuestFamily -ObjectType VirtualMachine -ValueFromExtensionProperty 'guest.guestfamily' -Force | Out-Null
New-VIProperty -Name GuestOSType -ObjectType VirtualMachine -ValueFromExtensionProperty 'guest.guestfullname' -Force | Out-Null


# Create an instance of Visio and create a document based on the Basic Diagram template.  
$AppVisio = New-Object -ComObject Visio.Application  
$docsObj = $AppVisio.Documents  
$DocObj = $docsObj.Add("Basic Network Diagram.vst")  
 
# Set the active page of the document to page 1  
$pagsObj = $AppVisio.ActiveDocument.Pages  
$pagObj = $pagsObj.Item(1)  
 
# Load a set of stencils and select one to drop  
$stnPath = [system.Environment]::GetFolderPath('MyDocuments') + "\My Shapes\"  
$stnObj1 = $AppVisio.Documents.Add($stnPath + $shpFile1)  
$VirtualMachine = $stnobj1.Masters.item("Virtual Machine (3D)")  
$VirtualAppliance = $stnobj1.Masters.item("3D Virtual Appliance")  
$vSphere = $stnobj1.Masters.item("vSphere")
$Clusters = $stnobj1.Masters.item("Clusters 2")
$VMware_Host=$stnobj1.Masters.item("VMware Host")
$datastores=$stnobj1.Masters.item("Disks 1")
  
#Connect-VIServer "Your vCenter Name" -Credential (Get-Credential)

$allNODES = Get-Cluster $cluster | get-vmhost
$allclusters = Get-Cluster $cluster
$allVMs = Get-Cluster $cluster | Get-VM  
$allDs = Get-Cluster $cluster | Get-Datastore

 
#Set Start Locations of Objects  
$x = 1  
$y = .5  
 
#DRAW ALL Cluster-NODES  
Foreach ($cluster in $allclusters) {  
    $y += 0.25  
    $clusterInfo = "CLUSTER: " + $cluster.Name  
    $clusterObj = add-visioobject $Clusters $clusterInfo
  
#DRAW ALL Datastore's and connect them to the cluster object
    Foreach ($d in $allDs) {  
          
            $x = -3  
            $y += 1.5  
            $dsInfo = "Datastore: " + $d.Name  + "`nDSCapacity(GB): " + [math]::Round([decimal]$d.CapacityGB,2)
            $datastores = add-visioobject $datastores $dsInfo  
            connect-visioobject $clusterObj $datastores
    
    }

#DRAW ALL Physical VMHOST NODES with Node Name, Total Memory and vCenter version and connect them to the cluster object
    Foreach ($node in $allNODES) {  
          
            $x = 2  
            $y += 1.5  
            $nodeInfo = "NODE: " + $node.Name  + "`eSXIVersion: " + $node.Version + "`nTotalMemory(GB): " + [math]::Round([decimal]$node.MemoryTotalGB,2)
            $nodeObj = add-visioobject $VMware_Host $nodeInfo  
            connect-visioobject $clusterObj $nodeObj      
        
# GET All Virtual Machines and drwa them based on the OS type and connect them to the Node object.
$allVMNodes = Get-VMHost $node | Get-VM | select guestfamily,guestostype | Group-Object guestostype |?{$_.name -ne ''} | select name,count
                
        foreach ($vm in $allVMNodes) {   
        
            $x += 2          
            $y += 1.5
            $vmInfo = "VM_OSType: " + $vm.Name  + "`nNo_of_VM's: " + $vm.count
            $VirtualMachine = add-visioobject $VirtualMachine $vmInfo
            connect-visioobject $nodeObj $VirtualMachine  
        
        }  

        }

        }

# Resize the Visio so that all fits in one page, nice and clean.
$pagObj.ResizeToFitContents()  

# Save the Visio file generated in desktop for each of the cluster.
$DocObj.SaveAs("C:\Users\vinithm\Desktop\vmwarelabvisio\$cluster.vsd")
        
}

Once the script kicks off, you would be stunned to see it open visio on its own and generate a network map right in front of your eyes with zero manual effort 🙂

And the best part if that when you browse to your  visio save folder, you would be treated to something like this 🙂

test

I hope you found this blogpost on generating Visio using PowerCLI useful and hope it helps you out!

Share this post

25 thoughts on “Visio using PowerCLI generate your vCenter Network Diagram

  1. When I try to run this against my ESX 6.0 cluster I’m getting the below errors.

    New-Object : Creating an instance of the COM component with CLSID
    {00021A20-0000-0000-C000-000000000046} from the IClassFactory failed due to
    the following error: 80004002 No such interface supported (Exception from
    HRESULT: 0x80004002 (E_NOINTERFACE)).
    At C:\Temp\vDiagram.ps1:43 char:13
    + $AppVisio = New-Object -ComObject Visio.Application
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [New-Object], InvalidCastExce
    tion
    + FullyQualifiedErrorId : System.InvalidCastException,Microsoft.PowerShel
    .Commands.NewObjectCommand

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:45 char:1
    + $DocObj = $docsObj.Add(“Basic Network Diagram.vst”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:49 char:1
    + $pagObj = $pagsObj.Item(1)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:53 char:1
    + $stnObj1 = $AppVisio.Documents.Add($stnPath + $shpFile1)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:54 char:1
    + $VirtualMachine = $stnobj1.Masters.item(“Virtual Machine (3D)”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:55 char:1
    + $VirtualAppliance = $stnobj1.Masters.item(“3D Virtual Appliance”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:56 char:1
    + $vSphere = $stnobj1.Masters.item(“vSphere”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:57 char:1
    + $Clusters = $stnobj1.Masters.item(“Clusters 2”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:58 char:1
    + $VMware_Host=$stnobj1.Masters.item(“VMware Host”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:59 char:1
    + $datastores=$stnobj1.Masters.item(“Disks 1”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Adding CLUSTER: Lab Cluster 1
    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:29 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    The property ‘Text’ cannot be found on this object. Verify that the property
    exists and can be set.
    At C:\Temp\vDiagram.ps1:31 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    Adding NODE: 192.168.199.100eSXIVersion: 6.0.0
    TotalMemory(GB): 7.91
    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:29 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    The property ‘Text’ cannot be found on this object. Verify that the property
    exists and can be set.
    At C:\Temp\vDiagram.ps1:31 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:17 char:5
    + $shpConn = $pagObj.Drop($pagObj.Application.ConnectorToolDataObject, 0,
    0)
    +
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:19 char:5
    + $connectBegin =
    $shpConn.CellsU(“BeginX”).GlueTo($firstObj.CellsU(“PinX”))
    +
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:21 char:5
    + $connectEnd = $shpConn.CellsU(“EndX”).GlueTo($secondObj.CellsU(“PinX”))
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:117 char:1
    + $pagObj.ResizeToFitContents()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Temp\vDiagram.ps1:120 char:1
    + $DocObj.SaveAs(“C:\Temp\$cluster.vsd”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Reply
  2. I tried the script and eveything works except the datastore part, I am getting the following error
    “Get-Datastore : The input object cannot be bound to any parameters for the
    command either because the command does not take pipeline input or the input
    and its properties do not match any of the parameters that take pipeline
    input.At C:\Users\ADAPAP1\Downloads\vDiagram\vDiagram_Network.PS1:64 char:33
    + $allDs = Get-Cluster $cluster | Get-Datastore
    + ~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (CLDLV-001:PSObject) [Get-D
    atastore], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,VMware.VimAutomation.ViCore.
    Cmdlets.Commands.GetDatastore”

    I know that the Get-Datastore should work, however it is not working in this case, any suggestions??

    Reply
      1. I upgraded my powerCLI from 5.1 to 5.5 Release 1 and the issue still persists, I don’t think its the powerCLI version, I think its somehow the way the script is executing and not able to store the output of Get-Datastore into the variable which is causing this issue. were you able to execute this in your environment without any issues? I still get the same error with Get-Datastore and everything else executes fine in the visio diagram.

        Reply
        1. can you manually run only that command on the powercli console and see whats the output, you would need to break it line by line. also please upgrade to powercli v6.0 r3 its the latest

          Reply
  3. I’m getting the same errors as Pradeep. I have PowerCLI 5.5 Release1. Running ‘Get-Datastores’ on its own, works fine. Any follow ups on this one.

    Reply
    1. Found this one to to pull the IPs of the VMs and put them in a .csv file. Not sure yet how to apply it for Visio.

      #Get IP list from All VM’s in vCenter

      $report = foreach($vm in Get-VM){

      $obj = [ordered]@{

      Name = $vm.Name

      Host = $vm.VMHost.Name

      }

      $i = 1

      $vm.Guest.IPAddress | %{

      $obj.Add(“IP$($i)”,$_)

      $i++

      }

      New-Object PSObject -Property $obj

      }

      $report | Sort-Object -Property {($_ | Get-Member -MemberType Properties).Count} -Descending |

      Export-Csv C:\Users\\Documents\machine_ip.csv -NoTypeInformation -UseCulture

      Reply
  4. I realize this post is somewhat dated now but it appears to still be an incredibly useful script with a few adjustments. The problem is that $pagObj is being called inside a function when it hasn’t been passed, thus the $null object errors. Try adding $pagObj as a parameter in the two functions and then passing it as a tertiary param when they are called later in the script.

    Before: function connect-visioobject ($firstObj, $secondObj)
    After: function connect-visioobject ($firstObj, $secondObj, $paramObj)

    Before: function add-visioobject ($mastObj, $item)
    After: function add-visioobject ($mastObj, $item, $pagObj)

    And the several instances when these functions are called:

    Before: $clusterObj = add-visioobject $Clusters $clusterInfo
    After: $clusterObj = add-visioobject $Clusters $clusterInfo $pagObj

    Before: connect-visioobject $clusterObj $nodeObj
    After: connect-visioobject $clusterObj $nodeObj $pagObj

    Reply
  5. Hello,

    I see this script may save my time and effort on preparing VMware Infrastructure Diagram, but unfortunately I received following messages on my PowerShell ISE when I run the script.

    I use

    PowerCLI Version: VMware vSphere PowerCLI 5.5 Release 1 build 1295336
    MS Visio 2013
    PowerShell 5.1

    Object reference not set to an instance of an object.
    At line:27 char:10
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

    The property ‘Text’ cannot be found on this object. Verify that the property
    exists and can be set.
    At line:29 char:10
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    You cannot call a method on a null-valued expression.
    At line:17 char:5
    + $connectBegin = $shpConn.CellsU(“BeginX”).GlueTo($firstObj.CellsU …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At line:19 char:5
    + $connectEnd = $shpConn.CellsU(“EndX”).GlueTo($secondObj.CellsU(“P …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Reply
    1. I know this is an old thread, but can you post what you did to resolve these errors? I’m getting the same issues and im not well versed in powershell enough to figure out whats happening.

      Reply
  6. I get an error at foreach ($cluster in $allclusters)
    >>
    At line:1 char:35
    + foreach ($cluster in $allclusters)
    + ~
    Missing statement body in foreach loop.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingForeachStatement

    I am on CLI 6.5 and Visio 2016

    Reply
  7. Thanks for the script.
    One question, how can I have this script write name of the VM? It does print names of datastores and hosts etc.
    Regards

    Reply
  8. I am getting errors with running this script. The errors are “You cannot call a method on a null-valued expression” . A visio file is created with a line, thats all. Below is longer snippet of error codes. Running on windows 10 pro, visio pro 2016, cli 11.2.0 and 11.4.0, i am connected with cli before running, and test ran few commands to confirm connection and able to pull data/info.

    I do have one question right after running the script I see there is a “file not found” error. What file?
    I did make one change to the original script -($shpFile1 = “EUC Visio Stencils 2015.vss”) i changed the name to remove the “VMware” part. Re-ran and still didn’t work.

    Any help would be great, thanks.

    Errors –

    PS C:\Users\test.user\Documents\My Shapes> .\vcenter2visio.ps1
    File not found.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:50 char:1
    + $stnObj1 = $AppVisio.Documents.Add($stnPath + $shpFile1)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:51 char:1
    + $VirtualMachine = $stnobj1.Masters.item(“Virtual Machine (3D)”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:52 char:1
    + $VirtualAppliance = $stnobj1.Masters.item(“3D Virtual Appliance”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:53 char:1
    + $vSphere = $stnobj1.Masters.item(“vSphere”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:54 char:1
    + $Clusters = $stnobj1.Masters.item(“Clusters 2”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:55 char:1
    + $VMware_Host=$stnobj1.Masters.item(“VMware Host”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:56 char:1
    + $datastores=$stnobj1.Masters.item(“Disks 1”)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Adding CLUSTER: domain-Primary
    Object reference not set to an instance of an object.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:26 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

    The property ‘Text’ cannot be found on this object. Verify that the property exists and can be set.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:28 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    Adding Datastore: VeeamBackup_myserver.mydomain
    DSCapacity(GB): 130.02
    Object reference not set to an instance of an object.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:26 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

    The property ‘Text’ cannot be found on this object. Verify that the property exists and can be set.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:28 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:16 char:5
    + $connectBegin = $shpConn.CellsU(“BeginX”).GlueTo($firstObj.CellsU …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:18 char:5
    + $connectEnd = $shpConn.CellsU(“EndX”).GlueTo($secondObj.CellsU(“P …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Adding Datastore: Datastore04
    DSCapacity(GB): 12287.75
    Object reference not set to an instance of an object.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:26 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

    The property ‘Text’ cannot be found on this object. Verify that the property exists and can be set.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:28 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:16 char:5
    + $connectBegin = $shpConn.CellsU(“BeginX”).GlueTo($firstObj.CellsU …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:18 char:5
    + $connectEnd = $shpConn.CellsU(“EndX”).GlueTo($secondObj.CellsU(“P …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Adding Datastore: localhost.LocalDatastore
    DSCapacity(GB): 269.75
    Object reference not set to an instance of an object.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:26 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

    The property ‘Text’ cannot be found on this object. Verify that the property exists and can be set.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:28 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:16 char:5
    + $connectBegin = $shpConn.CellsU(“BeginX”).GlueTo($firstObj.CellsU …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:18 char:5
    + $connectEnd = $shpConn.CellsU(“EndX”).GlueTo($secondObj.CellsU(“P …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Adding Datastore: Datastore02
    DSCapacity(GB): 5119.75
    Object reference not set to an instance of an object.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:26 char:11
    + $shpObj = $pagObj.Drop($mastObj, $x, $y)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

    The property ‘Text’ cannot be found on this object. Verify that the property exists and can be set.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:28 char:11
    + $shpObj.Text = $item
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

    You cannot call a method on a null-valued expression.
    At C:\Users\test.user\Documents\My Shapes\vcenter2visio.ps1:16 char:5
    + $connectBegin = $shpConn.CellsU(“BeginX”).GlueTo($firstObj.CellsU …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Reply

Post Comment