Python WMI Network Adapter Configuration parameter issue [Windows 8.1] [Python 2.7] [WMI 1.4.9]
<p>When I try to do this</p>

<pre><code>SetDynamicDNSRegistration(True)
</code></pre>

<p>It returns '68' which I have looked up on the <a href="https://msdn.microsoft.com/en-us/library/aa393298(v=vs.85).aspx" rel="nofollow">MSDN WMI page</a> and it means "Invalid Input Parameter".</p>

<p><strong>Full Script</strong></p>

<pre><code>import wmi

nic_configs = wmi.WMI('').Win32_NetworkAdapterConfiguration(IPEnabled=True)

# First network adaptor
nic = nic_configs[0]

# IP address, subnetmask and gateway values should be unicode objects
ip = u'192.168.0.151'
subnetmask = u'255.255.255.0'
gateway = u'192.168.0.1'
dns = u'192.168.0.1'

# Set IP address, subnetmask and default gateway
# Note: EnableStatic() and SetGateways() methods require *lists* of values to be passed
a = nic.EnableStatic(IPAddress=[ip],SubnetMask=[subnetmask])
b = nic.SetGateways(DefaultIPGateway=[gateway])
c = nic.SetDNSServerSearchOrder([dns])
d = nic.SetDynamicDNSRegistration(True)

print(a)
print(b)
print(c)
print(d)
</code></pre>

<p>What is wrong? I'm sure "True" is the right Python syntax for the boolean TRUE... I don't even know anymore...</p>

<p>Rather than a Python boolean, use its corresponding boolean integer. So instead of</p>

<pre><code>nic.SetDynamicDNSRegistration(True)
</code></pre>

<p>use</p>

<pre><code>nic.SetDynamicDNSRegistration(FullDNSRegistrationEnabled=1)
</code></pre>

python wmi