# Select the wired interface. $ethernetPortSettingsRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_EthernetPortSettings WHERE InstanceID='Intel(r) AMT Ethernet Port Settings 0'") $ethernetPortSettingsInstance = $ethernetPortSettingsRef.Get() $dhcpEnabled = $ethernetPortSettingsInstance.GetProperty("DHCPEnabled") $ipSyncEnabled = $ethernetPortSettingsInstance.GetProperty("IpSyncEnabled") $sharedDynamicIP = $ethernetPortSettingsInstance.GetProperty("SharedDynamicIP") $sharedStaticIP = $ethernetPortSettingsInstance.GetProperty("SharedStaticIp") if($ipSyncEnabled -like "false") { $ethernetPortSettingsInstance = $ethernetPortSettingsInstance $ethernetPortSettingsInstance.RemoveProperty("IPAddress") $ethernetPortSettingsInstance.RemoveProperty("SubnetMask") $ethernetPortSettingsInstance.RemoveProperty("DefaultGateway") $ethernetPortSettingsInstance.RemoveProperty("PrimaryDNS") $ethernetPortSettingsInstance.RemoveProperty("SecondaryDNS") $ethernetPortSettingsInstance.SetProperty("DHCPEnabled","false") $ethernetPortSettingsInstance.SetProperty("IpSyncEnabled","true") $ethernetPortSettingsRef.Put($ethernetPortSettingsInstance) }