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: https://support.adminarsenal.com/hc/en-us/community/posts/220479147-Remote-deployment-Background-service-not-running?input_string=Background%20Service%20is%20not%20running

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:

0

Comments

6 comments
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

     

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

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

    0
  • HA GOT IT!!

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

    0
  • Restart your background Service.

    0