The Remove-EnrollmentServiceLogcmdlet removes operational log entries from the Enrollment service database.

If you specify an end date, the Remove-EnrollmentServiceLogcmdlet only removes log entries created before the specified date. If you do not specify any parameters, the Remove-EnrollmentServiceLogcmdlet removes no log entries.


Remove-EnrollmentServiceLog [-EndDate <DateTime>]
[-WriteToFile <String>] [-WhatIf] [-Confirm]


The following describes the Remove-EnrollmentServiceLogcmdlet parameters.

EndDate <DateTime>

Specifies the latest operational log entry to remove from the database. The cmldet removes log entries before this date and time. If you do not specify a time, 00:00:00 (midnight) is the default setting.

WriteToFile <String>

Specifies the file path to which the cmdlet writes the deleted operation log entries, in comma-delimited text file (.csv) format. If the file does not exist, the cmdlet will create it. If the file already exists, the cmdlet will overwrite it.


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 Mobile Device Manager (MDM) Shell prompt, type, get-help about_commonparameters.

Input Type


Output Type



This Remove-EnrollmentServiceLogcommand example removes all Enrollment service log entries before January 14, 2007, and writes the deleted entries into the .csv file, archive.csv.

Copy Code
C:\PS>Remove-EnrollmentServiceLog -enddate "1/14/07"
-writetofile archive.csv

Cmdlet Help

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

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

See Also