Remove-EnrollmentRequest

2/9/2009

The Remove-EnrollmentRequest cmdlet 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-EnrollmentRequest cmdlet removes all expired records from the database.

Syntax

Remove-EnrollmentRequest [[-Name] <string>] [-EnrollmentId <string>] [-Owner <AdUserParameter>] [-confirm] [-whatif] [<CommonParameters>]

Parameters

The following describes the Remove-EnrollmentRequest cmdlet 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 Owner parameter is null, the cmdlet uses the word Anonymous for this parameter.
  • WhatIf
    Informs you of what changes would be made if the action were to be performed (the cmdlet is not executed).
  • Confirm
    Prompts you for confirmation before the cmdlet executes.
  • CommonParameters
    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.

Input Type

The Remove-EnrollmentRequest cmdlet accepts a string through the pipeline that identifies a Windows Mobile device, or an object that has the properties name, owner, or enrollmentId.

Output Type

The Remove-EnrollmentRequest cmdlet returns an EnrollmentRequest object. To see all the properties for the EnrollmentRequest object, at the MDM Shell prompt, type Get-EnrollmentRequest | Get-Member.

Examples

This Remove-EnrollmentRequest command example removes a pending enrollment request for the Windows Mobile device, Device1.

C:\PS>Remove-EnrollmentRequest -Name Device1

This Remove-EnrollmentRequest command example searches for all the pending enrollment requests for the owner, Mikael Sandberg. If there is only one pending request, the Remove-EnrollmentRequest command removes the pending enrollment request. If there is more than one request, an error message displays and the Remove-EnrollmentRequest command removes no requests.

C:\PS>Remove-EnrollmentRequest -Owner "Mikael Sandberg"

This Remove-EnrollmentRequest command example removes all expired enrollment requests.

C:\PS>Remove-EnrollmentRequest

Cmdlet Help

To view this information online, at the MDM Shell prompt, type:

get-help Remove-EnrollmentRequest -detailed, or get-help Remove-EnrollmentRequest -full

See Also

Reference

New-EnrollmentRequest
Get-EnrollmentRequest