def updateMobileDeviceName(mobileSearch, deviceName, username, password):
print 'Updating Mobile Device name for mobile device ' + mobileSearch + ' to ' + deviceName + '...'
newDeviceName_normalized = urllib2.quote(deviceName)
mobile_id = getSupervisedMobileDeviceId(mobileSearch, username, password)
if str(mobile_id) == '-1':
print 'Mobile device ' + mobileSearch + ' not found, please try again.'
return -1
elif str(mobile_id) == '-2':
print 'More than one mobile device matching search string ' + str(mobileSearch) + ', please try again.'
return -1
elif str(mobile_id) == '-3':
print 'Device found, but is not supervised.'
postStr = jss_api_base_url + '/mobiledevicecommands/command/DeviceName/' + newDeviceName_normalized + '/id/' + mobile_id
postXML = "<mobile_device_command><command>DeviceName</command><mobile_devices><mobile_device><id>" + mobile_id + "</id><device_name>" + deviceName + "</device_name></mobile_device></mobile_devices></mobile_device_command>"
评论列表
文章目录