Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Prevent schedules with heartbeat during MDT-Deploy


i use the following PowerShell script with MDT to trigger a PDQ deployment.

netsh advfirewall set allprofiles state off
ipconfig /registerdns
psexec.exe \\SERVER -h -accepteula ipconfig /flushdns
psexec.exe \\SERVER -h -accepteula "C:\Program Files (x86)\PDQ Deploy\pdqdeploy.exe" Deploy -Package "MDT-Deploy" -Targets $env:COMPUTERNAME
start-sleep -s 30
while(test-path "C:\Windows\AdminArsenal\PDQDeployRunner\service-1.lock"){
start-sleep -s 30

This works fine, but when i have further schedules which use heartbeat, they start before or after my MDT-Deploy. When it starts after the actual MDT-Deploy, the schedule doesn't finish because the client reboots.

I changed the script in this way:

while(test-path -Path "C:\Windows\AdminArsenal\PDQDeployRunner\*" -Include *.lock){

Are there better ways to prevents schedules with heartbeat during MDT?




Date Votes
  • Why don't you just not have it join the domain until the last step. That way PDQ Inventory doesn't even see it until then

  • I did not think of that, but it would be a good/possible solution.


  • You could also make the MDT-Deploy create a txt file once its done. Then for the heartbeat packages add a condition so the only run if the machine already has the txt file created by MDT-Deploy.