The Remove-EnrollmentRequestcmdlet removes a pending enrollment request for a Windows Mobile device.
You can identify the enrollment request to remove by specifying the device, owner, or enrollment ID. If the command finds a single matching record, it removes the pending enrollment request. If the command finds multiple matching records, an error message displays and the command removes no records.
If you call this cmdlet without parameters, the Remove-EnrollmentRequestcmdlet removes all expired records from the database.
Remove-EnrollmentRequest [[-Name] <string>] [-EnrollmentId <string>] [-Owner <AdUserParameter>] [-confirm] [-whatif] [<CommonParameters>]
The following describes the Remove-EnrollmentRequestcmdlet parameters.
- Name <String>
Specifies the distinguished name, DNS host name, or the common name of the Windows Mobile device. If the value contains a space or other special characters, enclose the string in quotation marks.
- Owner <AdUserParameter>
Specifies the common name, e-mail address, distinguished name, security ID (SID), or Logon ID of the owner of the Windows Mobile device. This owner must exist in Active Directory, or, if you specify a null value, the cmdlet uses the owner name, Anonymous. If the value contains a space or other special characters, enclose the string in quotation marks.
- EnrollmentId <String>
Specifies the identity string that is used to enroll the Windows Mobile device. If you specify a null value, the cmdlet uses the e-mail name of the owner. If an e-mail name is not available, the cmdlet uses the logon ID. If the Ownerparameter is null, the cmdlet uses the word Anonymous for this parameter.
Informs you of what changes would be made if the action were to be performed (the cmdlet is not executed).
Prompts you for confirmation before the cmdlet executes.
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, at the MDM Shell prompt, type, get-help about_commonparameters.
The Remove-EnrollmentRequestcmdlet accepts a string through the pipeline that identifies a Windows Mobile device, or an object that has the properties name, owner, or enrollmentId.
The Remove-EnrollmentRequestcmdlet returns an EnrollmentRequestobject. To see all the properties for the EnrollmentRequestobject, at the MDM Shell prompt, type Get-EnrollmentRequest | Get-Member.
This Remove-EnrollmentRequestcommand example removes a pending enrollment request for the Windows Mobile device, Device1.
C:\PS>Remove-EnrollmentRequest -Name Device1
This Remove-EnrollmentRequestcommand example searches for all the pending enrollment requests for the owner, Mikael Sandberg. If there is only one pending request, the Remove-EnrollmentRequestcommand removes the pending enrollment request. If there is more than one request, an error message displays and the Remove-EnrollmentRequestcommand removes no requests.
C:\PS>Remove-EnrollmentRequest -Owner "Mikael Sandberg"
This Remove-EnrollmentRequestcommand example removes all expired enrollment requests.
To view this information online, at the MDM Shell prompt, type:
get-help Remove-EnrollmentRequest -detailed, or get-help Remove-EnrollmentRequest -full