Report of Logical Networks in SCVMM 2012 SP1

After working with an implementation and upgrade from SCVMM 2012 to SCVMM 2012 SP1 I have been trying to mitigate the issues with the old database and that with the network changes that arrived in SP1 has not been the best way.

Now I have decided to reinstall the VMM database to get a fresh start :-). Yes I lose some history but at least I get a system that will probably work!

I still want to get all the network information that I had in the old db to be able to create new virtual networks with the same network information

Here is an simple PowerShell script that helped me in getting the info

# Easy report of Logical Networks and subnet sites with vlans
#
# Niklas Akerlund

# Import Module
Import-Module virtualmachinemanager

# all Logical network definitions
$LogicalNetsdef = Get-SCLogicalNetworkDefinition

Foreach ($def in $LogicalNetsdef){
    
    foreach ($SubnetVlan in $def.SubnetVLans){
        $data=[ordered]@{
                    LogicalNetworkName = $def.LogicalNetwork.Name
                    Name=$def.Name
                    Subnet=$SubnetVlan.Subnet
                    VlanID=$SubnetVlan.VLanID
                }
         $Obj=New-Object -TypeName PSObject -Property $data  
         Write-Output $Obj   
    }

}

And when running it I pipe the info to a csv export

Screen Shot 2013-09-20 at 10.29.31

And here is the csv file

Screen Shot 2013-09-20 at 10.54.21

Comments

Raji
Reply

This was excellent. Thank you. Worked like a charm