Reinstalling Computers

ATTENTION: Beginning with DSM 2015.2 change have been introduced when executing this task. Please see the notes at the end of this chapter and the content of chapter Alternatives for different functionality in DSM 2015.2.


Through calling the cmdlet Reinstall-EmdbComputer the task "Reinstall computer" is executed on the specified Computer object.


The following optional command line parameters are supported:

  • -StartImmediately
    Forces the reinstallation process to start at the next reboot. Without this switch parameter, the operation mode of the Computer is set to "Prepared for Reinstall".

  • -PreservePolicyInstanceRevisions
    Prevents the Revision numbers of existing Policy-Instances from being updated to the current value of the corresponding Policy. Without this switch parameter, the Revision numbers are updated to the most recent Revision numbers of the corresponding Policy.

  • -RecalculateInstallationOrder
    Forces the recalculation of  the Installation-Order regarding the InstallationOrder-IDs of the Policies. Without this parameter, the current Installation-Order is preserved.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


Cd "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Workstations"

Reinstall-EmdbComputer "XP01" -StartImmediately -RecalculateInstallationOrder


Note: The goal to reinstall a Computer could be reached with DSM-versions until 2015.1 through the following code-snippets. Beginning with DSM 2015.2 these possibilities do no longer work.


Option 1:

$MyComputer.OperationMode = "PrepareForReinstall"

$MyComputer.Update()


Option 2:

$MyComputer.PrepareForReinstall()