Skip to content

Instantly share code, notes, and snippets.

@Stephanevg
Created July 18, 2016 13:08
Show Gist options
  • Save Stephanevg/6ec21b070dea3a406aa57e057783ef74 to your computer and use it in GitHub Desktop.
Save Stephanevg/6ec21b070dea3a406aa57e057783ef74 to your computer and use it in GitHub Desktop.
Manage-SurfaceNetworkAdapter
Function Get-CMSurfaceNetworkAdapter {
Param(
[string]$Add,
[string]$Remove,
[switch]$ListSurfaceAdapters
)
#Based on following technet article: https://blogs.technet.microsoft.com/system_center_configuration_manager_operating_system_deployment_support_blog/2015/08/27/reusing-the-same-nic-for-multiple-pxe-initiated-deployments-in-system-center-configuration-manger-osd/
$Root = 'HKLM:\SOFTWARE\Microsoft\SMS\Components\SMS_DISCOVERY_DATA_MANAGER'
$Item = 'ExcludeMACAddress'
if ($ListSurfaceAdapters){
Get-NetAdapter | ? {$_.ifDesc -eq 'Surface Ethernet Adapter'}
}elseif($Add){
#Too add
elseif($Remove){
#Too Add
}
}else{
(Get-ItemProperty -Path $Root -Name $Item).$Item
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment