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: https://blw.rocks/mdt-trigger-pdq-deploy-deployment/

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?

https://support.pdq.com/hc/en-us/articles/115000083832-Configuring-Central-Server-PDQ-Deploy#Service

 

 

 

0

Comments

4 comments
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 support@pdq.com so they can help you sort that error out. Once that is working, the Invoke-Command you've got should do the trick.

    0
  • 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%

    0
  • 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
  • 0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post