Eject CD script, quarantined by FEP! PowerShell to the rescue!

I guess everyone knows that you can’t enable BitLocker on a machine from a Task Sequence if there is a CD in the CD drive… The workaround is quit simple, just run a script to eject the cd drive before running the “enable BitLocker” step.

Well the other day this script, a vbs, I use, was removed by Forefront.. I guess the heuristic scan evaluated the content of the script to be unsafe, and quarantined it.. This is obviously not good, as it’s needed by the task sequence… So I thought, maybe there is a way to eject the CD without the need of a script, so I don’t have to convince the FEP admin to make an exception allowing this script to be present.

And what do you know, once again PowerShell to the rescue.. Just run this command from a “Run Command Line” step, and the CD will eject!

Powershell ((New-Object -ComObject "WMPlayer.ocx").cdromCollection).Item(0).Eject()


Because the command is executed without the need of a script you don’t even have to worry about PowerShell script execution policies…

By |2012-03-22T12:25:53+00:00March 22nd, 2012|General info, OS Deployment, Powershell, Security|3 Comments

About the Author:

Michael Petersen
Twitter: @OSDeployLinkedin: Michael PetersenMicrosoft Community Contributor


  1. […] La solution pour éviter ce problème serait alors d’utiliser Powershell comme le propose Michael Petersen. […]

  2. Mark June 5, 2013 at 17:30 - Reply

    This is still some helpful information. If anyone is encountering 0x80310030 in SCCM OSD Task Sequences. Run this powershell command before you add TPM protectors.

  3. agar.io free hack November 9, 2016 at 3:36 - Reply

    Nevertheless the competition in this particular game has increased it is because the
    number of players taking part in online has additionally increased.

Leave A Comment