MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
633 stars 281 forks source link

Webservice 1.7.0 : ImportCMComputerByMacAddress broken? #151

Closed MaartenPauchet closed 5 years ago

MaartenPauchet commented 5 years ago

When trying to import a new device using ImportCMComputerByMacAddress the device is not being created.

$Invocation = $WebService.ImportCMComputerByMacAddress( $SecretKey,'11:22:33:44:55:66','XXYYY1234')

I checked the eventlog which talks about a problem logged by smsprovider. So I checked SMSPROV.LOG and noticed an error that the MAC address provided through the webservice is not in the right format. I tried different formats 11:22:33:44:55:66 112233445566 11-22-33-44-55-66 but the error is always the same.

when doing a manual import through the console the smsprog logs the mac in the format 11:22:33:44:55:66 so my assumption is that this is the correct format.

I've check the rights of the account that is being used by the webservice and even gave it temporary Operational admin just for testing. did not make a difference. Attached the snipped of the smsprov.log for your reference

smsprov-importpc
MaartenPauchet commented 5 years ago

HA! found it just now by looking back at the log... the function works but the documentation has the parameters in the wrong order. its ImportCMComputerByMacAddress( $SecretKey,$ComputerName,$MAC)!

NickolajA commented 5 years ago

This will be addressed in the 1.8.0 update of the docs.