How to run besremove remotely?

Does anyone know how to run besremove remotely using psexec?

I presume you don’t mean run by an agent? Fixlet 219 in BES Support uses BES Remove by an agent so its similar to how you would run BESRemove via a command line.

The machine is not reporting to the console because of a problematic client, and would like to uninstall it remotely.

I tried to run the below command but it does not remove all the files under the BigFix Enterprise/BESClient directory.

PsExec.exe \\computername “C:\besremove.exe” /silent /client

If you have Powershell Remoting enabled, you could execute that way.

Hi JonL,

Can you provide me an example? Thanks!

I was able to successfully uninstall a client remotely by using pstools. I tested on two machines, and confirmed that it works.

PsService.exe \\computername stop besclienthelper
PsService.exe \\computername stop besclient
PsExec.exe \\computername “C:\besremove.exe” /silent /force /client

Now I would like to put the commands on a batch file, can someone help on how to accomplish it?

You can add those commands into a batch, then call the batch with psexec instead of each command directly.

So should I just copy and paste it? Is it also possible to point to a text file containing a list of computer names or ip addresses?

From a Powershell remoting perspective (assuming it is enabled), you could do something like this by inserting your own “script item(s)”:

$myCredential = Get-Credential
Get-Content –Path "C:\Temp\ComputerList.txt” | ForEach-Object –Process `
{
Write-Host "Store $PSItem"
Invoke-Command -Computer ($PSItem + “.domain.com”) -ScriptBlock { script item } -Credential $myCredential
#Invoke-Command -Computer ($PSItem + “.domain.com”) -ScriptBlock { script item } -Credential $myCredential
}

Likewise you could do a simliar script on your end that would involve psexec and iterate through a list.