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.

Need help with MDT - Remote Command

So I want to use MDT to deploy a workstation, and when its complete, have it run a command to launch PDQ deploy and  install a package. 

I found this link:

to do this:

Invoke-Command -ComputerName YOUR.PDQ.SERVER -ScriptBlock { param ($compname) & 'C:\Program Files (x86)\Admin Arsenal\PDQ Deploy\pdqdeploy.exe' Deploy -Package "PACKAGE_NAME" -Targets $compname} -ArgumentList "$env:COMPUTERNAME"


But it fails.  If I hange the registry key for HKEY_LOCAL_MACHINE\SOFTWARE\Admin Arsenal\PDQ Deploy\ServicePort set, but once I do so the service failes to start. 


Do I need to configure a central server for this to work?






Date Votes
  • Should work without Central Server. You will certainly need to change the ServicePort before Invoke-Command will work to kick off pdqdeploy.exe. What error are you getting after you set the service port and start the service? 

    I'd recommend reaching out to support directly by emailing so they can help you sort that error out. Once that is working, the Invoke-Command you've got should do the trick.

  • I use two Run Command Lines within my Task Sequence to deploy packages with an baseline packages. This installs psexec onto the machine and then uses psexec to call the server to deploy the package


    xcopy "File path" /E "C:\Windows\System32" /s /i
    SETX /M PATH "%PATH%C:\Windows\System32\PSTools"

    for /f "skip=1 delims={}, " %%A in ('wmic nicconfig get ipaddress') do for /f "tokens=1" %%B in ("%%~A") do set "IP=%%~B"

    psexec \\server -u username -p password -h -accepteula "C:\Program Files (x86)\Admin Arsenal\PDQ Deploy\pdqdeploy.exe" Deploy -Package "Baseline" -Targets %ip%

  • We took a different approach.  Instead of using psexec or Invoke-Command, we use a scheduled task that fires when a particular event is logged to the Windows event log of the PDQ server.  The scheduled task just runs the same pdqdeploy command line options but we found this method to be more reliable.  An added bonus is that we have a history of the events in the event log.


  • 0