Prevent schedules with heartbeat during MDT-Deploy

0

Hello,

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?

THX

Cancel
login to comment
0

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.

THX

Cancel
login to comment

0

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.

Cancel
login to comment

Reply