Running the following command
set-casmailbox -Identity $DN -ActiveSyncAllowedDeviceIDs @{ add = $DeviceID }
sometimes brings a warning