Events
Apr 29, 2 PM - Apr 30, 7 PM
Join the ultimate Windows Server virtual event April 29-30 for deep-dive technical sessions and live Q&A with Microsoft engineers.
Sign up nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In System Center Virtual Machine Manager (VMM), you can centrally configure and manage software defined network (SDN) port access control lists (ACLs).
Note
Port ACL settings are exposed only through PowerShell cmdlets in VMM and can't be configured in the VMM console.
Using VMM PowerShell, you can also configure Hyper-V port ACLs. For more information, see Hyper-V port ACLs.
This article provides information on how to create and manage SDN port ACLs by using the VMM PowerShell cmdlets.
Ensure that SDN network controller is deployed.
Open PowerShell in VMM.
Create a port ACL.
PS C:\> New-SCPortACL -Name "RDPAccess" -Description "PortACL to control RDP access" -ManagedByNC
Note
The parameter -ManagedByNC ensures that the port ACL is managed by Network Controller (NC) and can only be attached to NC managed objects. The cmdlets provided here use example values.
Get an existing port ACL.
PS C:\> $portACL = Get-SCPortACL -Name "RDPAccess"
Create a port ACL rule.
PS C:\> New-SCPortACLRule -Name "AllowRDPAccess" -PortACL $portACL -Description "Allow RDP Rule from a subnet" -Action Allow -Type Inbound -Priority 110 -Protocol Tcp -LocalPortRange 3389 -RemoteAddressPrefix 10.184.20.0/24
Note
Get the virtual network adapter.
PS C:\> $vm = Get-SCVirtualMachine -Name “TenantVM”
PS C:\> $adapter = Get-SCvirtualNetworkAdapter -VM $vm"
Attach an existing port ACL to the virtual network adapter.
PS C:\> $portACL = Get-SCPortACL -Name "RDPAccess"
PS C:\> Set-SCVirtualNetworkAdapter -VirtualNetworkAdapter $adapter -PortACL $portACL
Note
You can also attach a port ACL while creating the virtual network adapter through New-SCVirtualNetworkAdapter cmdlet. Learn more.
Get the virtual network adapter that you want to detach the port ACL from.
PS C:\> $vm = Get-SCVirtualMachine -Name “TenantVM”
PS C:\> $adapter = Get-SCvirtualNetworkAdapter -VM $vm
Detach the port ACL from the virtual network adapter.
PS C:\> Set-SCVirtualNetworkAdapter -VirtualNetworkAdapter $adapter -RemovePortACL
Get the VM subnet to attach the ACL.
PS C:\> $vmSubnet = Get-SCVMSubnet -Name “Tenant Subnet”
Attach an existing port ACL to the VM subnet.
PS C:\> Set-SCVMSubnet -VMSubnet $vmSubnet -PortACL $portACL
Note
You can also attach a port ACL while creating VM subnet through New-SCVMSubnet cmdlet. Learn more.
Get the VM subnet that you want to detach the port ACL from.
PS C:\> $vmSubnet = Get-SCVMSubnet -Name “Tenant Subnet”
Detach the port ACL from the VM subnet.
PS C:\> Set-SCVMSubnet –VMSubnet $vmSubnet -RemovePortACL
Get the port ACL rule that you want to remove.
PS C:\> $portACLRule = Get-SCPortACLRule –Name “AllowRDPAccess”
Remove the port ACL rule.
PS C:\> Remove-SCPortACLRule -PortACLRule $portACLRule
Get the port ACL that you want to remove.
PS C:\> $portACL = Get-SCPortACL -Name “RDPAccess”
Remove the port ACL.
PS C:\> Remove-SCPortACL -PortACL $portACL
Events
Apr 29, 2 PM - Apr 30, 7 PM
Join the ultimate Windows Server virtual event April 29-30 for deep-dive technical sessions and live Q&A with Microsoft engineers.
Sign up nowTraining
Module
Create and implement application allowlists with adaptive application control - Training
You're able to implement Adaptive application controls within your organization to protect your Windows Server IaaS VMs.
Certification
Microsoft Certified: Azure Network Engineer Associate - Certifications
Demonstrate the design, implementation, and maintenance of Azure networking infrastructure, load balancing traffic, network routing, and more.