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.

Background Service is not running

I am referring to the script in this thread:

Which says:

$secpasswd = ConvertTo-SecureString "DOMAIN_ADMIN_PASSWORD" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ("DOMAIN\DOMAIN_ADMIN",$secpasswd)
$remotecomputer = Get-Content env:computername

Invoke-Command -ComputerName SERVER_RUNNING_PDQ_DEPLOY -Credential $creds -ScriptBlock { param($name) & 'C:\Program Files (x86)\Admin Arsenal\PDQ Deploy\PDQDeploy.exe' Deploy -Package 'PDQ_DEPLOY_PACKAGE_NAME' -Target $name } -ArgumentList $remotecomputer


However when I run this I get this error:



Date Votes
  • $remotecomputer = Get-Content env:computername

    That's going to vomit red text all over a prompt. 

    1.  You can't Get-Content that variable
    2.  it's $env:computername, not env:computername


    In order for this to work, you have to do a couple of things. 

    1.  You need to make sure the account you are using for the Creds of the Invoke-Command are listed in the Console Users section of preferences
    2. Use TCP not named Pipes
    • Location: HKEY_LOCAL_MACHINE\SOFTWARE\Admin Arsenal\PDQ Deploy
    • Value: ServicePort (DWORD value)
    • It can be any port you want

    Finally, the code should look like this:

    Invoke-Command -ComputerName <pdq server> -Credential $creds -ScriptBlock{ pdqdeploy.exe Deploy -Package <package name> -Targets $args[0] } -ArgumentList $RemoteComputer


  • Adding the port caused PDQ to not open. Is there a value I need to stay between?

    I remember them saying something about the service port in a video, but I can't find that video to save me

  • Restart your background Service. That should fix that issue.

  • HA GOT IT!!

  • Thanks you Stephen.. and I found the video too. 

  • Restart your background Service.