title: Delete User Command description: Delete a user's account from a device. payload: requesttype: DeleteUser supportedOS: iOS: introduced: '9.3' accessrights: None supervised: false requiresdep: false sharedipad: mode: required devicechannel: true userchannel: false userenrollment: mode: forbidden macOS: introduced: '10.13' accessrights: None devicechannel: true userchannel: false supervised: true requiresdep: false userenrollment: mode: forbidden tvOS: introduced: n/a visionOS: introduced: n/a watchOS: introduced: n/a content: This command allows the server to delete a user that has an active account on the device. payloadkeys: - key: UserName type: presence: optional content: The user name of the account to delete. The device requires this key when the value for `DeleteAllUsers` is absent or `false`. - key: ForceDeletion supportedOS: macOS: introduced: n/a type: presence: optional default: false content: If `true`, the system deletes the account even if the user has data that's pending sync to the cloud. - key: DeleteAllUsers supportedOS: iOS: introduced: '14.0' macOS: introduced: n/a type: presence: optional default: false content: If `true`, the system attempts to delete all users from the device. If `ForceDeletion` is `false`, the system generates an error instead and doesn't delete users who have data that's pending sync. notes: - title: '' content: Refer to the following sections to determine supported channels and requirements, and to see an example request and response. - title: Error codes content: |- An error response uses one of the following error codes: - `12071`: The user doesn't exist. - `12072`: The user is currently logged in. - `12073`: The user has data to sync and ForceDeletion is false or unspecified. - `12074`: Unable to delete the user. In macOS, this error code also returns for an attempt to delete the last administrator account. examples: - title: Example request and response files: - request-file: examples/mdm/commands/classroom.user.delete/example1.plist response-file: examples/mdm/commands/classroom.user.delete/example2.plist