Deleting SCVMM 2012 R2 Logical Network Definitions with PowerShell.

Attempting to delete a SCVMM 2012R2 logical network throws an exception as shown in the screen shot below because there are other dependencies like the Port Profiles, logical switches and other network objects still depending on it.


The “View Dependent Resources” page displays the current Logical network definition dependencies preventing the Logical network from being removed.


We can remove the network definitions with PowerShell after which we delete the logical network.


Get-SCLogicalNetworkDefinition -LogicalNetwork "Test Logical Network" | Remove-SCLogicalNetworkDefinition -Verbose

The PowerShell script gets the specified Logical network definition for the specified LogicalNetwork parameter and pipes the result to the Remove-SCLogicalNetworkDefinition

In the next script, we use the Get-SCLogicalNetwork to retrieve the specified Logical network and pipe the result to the Remove-SCLogicalNetwork

Get-SCLogicalNetwork -Name "Test Logical Network" | Remove-SCLogicalNetwork -Verbose


Running the Get-SCLogicalNetwork -Name "Test Logical Network" doesn’t return any value. This confirms the removal was successful.

This entry was posted in SCVMM2012R2, System Center 2012 R2, VMM2012R2, Windows Server 2012 R2 and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s