BesAdmin Tool 9.5 Automation

I Recently upgraded to 9.5.3 from 9.2.4 and found that the the BesComputerRemover tool no longer is supported. Previously i used a sheduled task to automate the removal of systems via powershell and the BesComputerRemover tool. Now, the functionality of the new method falls a bit short of automating the removal of dead or decommissioned servers. Is there a way to use powershell to initiate the admin tool without the GUI requesting the password for the Master Deployment Account? I have not found anything in the additional administion commands

https://www.ibm.com/support/knowledgecenter/en/SS6MCG_9.5.0/com.ibm.bigfix.doc/Platform/Installation/c_additional_besadmin_onwindows.html

What i am hoping to do is create a scheduled task that does the following set of actions.

  • Copy and Rename an archived report from .\LastRunReports that has a list of servers that have not reported in X Days:

      > Copy-Item "D:\Program Files (x86)\BigFix Enterprise\BES Server\BESReportsData\ArchiveData\LastRunReports\1.dat" "C:\AWS_Related\awscomputers.txt" -force
    
  • Initiate the BESAdmin tool with the following command line:

    > "D:\Program Files (x86)\BigFix Enterprise\BES Server\BESAdmin.exe" /run /removecomputersfile="C:\BigFix_Working_Dir\awscomputers.txt"
    

Any Assistance with this would be greatly appreciated.

Unless I am missing something, why could you not just set your settings from the ADMIN tool “clean Up” tab?
It seems that you were running a Web Report to find the Endpoints that have not “checked in” for X number of days, then initiate the Power Shell to remove them, which could be done via the Clean up tab"

2 Likes

Although this would accomplish removing stale machines globally, i want to have the flexibility to delete machines based on certain conditions, such as cloud based machines that have not reported in 5 days. Perhaps submitting a RFE to add remove computers buy file. I suppose that in the interim, i could use Rest API calls to delete the systems I want. Thanks for your response.

Actually, it is possible to delete computers by file currently via BESAdmin’s command-line options. Please see the ‘/removecomputers’ and ‘removecomputersfile’ options described here:

https://www.ibm.com/support/knowledgecenter/SSQL82_9.5.0/com.ibm.bigfix.doc/Platform/Installation/c_additional_besadmin_onwindows.html#c_additional_besadmin_onwindows

Indeed, however when I initiate with the the above command in first post, the BesAdmin GUI interface is presented which is prohibiting automated processes.

Thanks for the info.

I believe this is due to an incorrect syntax in the command specified in the first post. Can you try:

“D:\Program Files (x86)\BigFix Enterprise\BES Server\BESAdmin.exe” /removecomputers /run
/removecomputersfile=“C:\BigFix_Working_Dir\awscomputers.txt”

3 Likes

That was it! Thanks again Aram :relaxed:

1 Like

By the way, this is the finished powershell script and works perfectly. Thanks again Aram for your catch on my command line. Pehaps this will be handy for others.

Set-ExecutionPolicy -Scope CurrentUser Unrestricted
Set-ExecutionPolicy Unrestricted Process
$file = "C:\BigFix_Working_Dir_Custom\awscomputers.txt"

####//Copy File
Copy-Item "D:\Program Files (x86)\BigFix Enterprise\BES Server\BESReportsData\ArchiveData\LastRunReports\1.dat" $file -force

####//Remove first line of file
Get-Content $file | Select-Object -Skip 1 | Out-File $file-temp -Force
Move $file-temp $file -Force

####//Verify that file has data before running besadmin tool
 if((Get-Item $file).length -gt 0kb){
 $Command = "D:\Program Files (x86)\BigFix Enterprise\BES Server\BESAdmin.exe"
 &$command /removecomputers /run /removecomputersfile=$file
 }
 else
 {
 }
####//count down before forcing tool closure - large deployment needs more time
start-sleep -s 10 

####// Kill Besadmin confirmation dialog in background 
$ProcessActive = Get-Process besadmin -ErrorAction SilentlyContinue
if($ProcessActive -eq $null)
{
}
else
{
TaskKill /F /IM besadmin.exe /T
2 Likes