I have a problem where I have created a batch file for the installation of MS Teams through BF SWD. The batch file runs perfectly outside of BigFix, but when pushed by SWD it doesn’t work. The batch file is created in such a way that it temporarily maps to a central repository in the environment in order to retrieve and install said packages. What could be the cause of BigFix not being successful?
I have now encountered this problem with Microsoft Office as well as Teams.
Likely it’s the “maps to a central repository” that’s the problem.
The BigFix client is running as the LocalSystem account, and won’t be able to access UNC drives like \servername\sharename. In Active Directory, Computer accounts are not allowed to connect to the shares, only authenticated user accounts.
Since you have the Software Deployment offering, why not use “Manage Software Distribution” dashboard to import/upload your installers instead of using the UNC share?
The other consideration is that MS Teams is available as both a per-user and a system-wide installation. You should use the system-wide installer to avoid having to deal with per-user installations.
Thank you for your reply. The batch file makes provision for the permissions to the central repository. I have added the contents below for an Office install .bat file. Would that still hinder access?
Any guidance would be appreciated as I’m busy pulling my hair out at the moment.
:: @echo off
setlocal
set /A ERRORNO=0
::Store working directory to return after finished
set WORKDIR=C:
set SHARESRV=::Removed::
set SHAREDIR=BigFixProf_SWD_\Office2013Pro-32bit
::Map network drive and give it unmapped drive letter
net use * \%SHARESRV%%SHAREDIR% /user:
::Map and switch to a network drive and give it unmapped drive letter
pushd \%SHARESRV%%SHAREDIR%
::Store the name of the network drive so it can be unmapped when finished
set NETSHARE=%CD%
set NETDRIVE=%CD:~0,2%
::Change to the Network Share Drive
cd /d %NETSHARE%
::Run commands with the network drive mapped
setup.exe /adminfile proplus2013-32.MSP
::Uncomment this to catch errors from the executable
if %errorlevel% GTR 0 set ERRORNO^|=%errorlevel%
::Change back to the original directory
cd /d %WORKDIR%
::Unmap the network drive
net use %NETDRIVE% /delete /y
Looks like that should overcome the network share credential issue…what does your ActionScript look like? What is the exit code? We should be able to modify it to save a log file and see where it’s failing.
begin prefetch block
add prefetch item name=f2cd41e8f605059de983742e68fa4c51a5cf52bd sha1=f2cd41e8f605059de983742e68fa4c51a5cf52bd size=762 url=SWDProtocol://127.0.0.1:52311/Uploads/f2cd41e8f605059de983742e68fa4c51a5cf52bd/Teams_Windows_x64.bat.bfswd sha256=7d4705d3201ecda978e6a92b2ecaea453e10bb930532eef76fcc97a6127f54a4
end prefetch block
// All SWD files will go into a folder in the clients __BESData folder. This folder gets cleared on every restart.
parameter “baseFolder” = “__Download/”
// Move files into subfolders and unescape file names
move “__Download/f2cd41e8f605059de983742e68fa4c51a5cf52bd” “{parameter “baseFolder”}Teams_Windows_x64.bat”
// Log setup
parameter “mainSWDLogFolder” = "{parent folder of client folder of current site}/__Global/SWDDeployData"
folder create "{parameter “mainSWDLogFolder”}"
parameter “logFile” = “SWD_DeploymentResults.log”
//**End Preparation Marker
delete __createfile
parameter “logFolder” = “{parameter “mainSWDLogFolder”}”
// Run setup process
delete run.bat
// Use .bat to set working directory to packages root, for setup command.
createfile until end @ECHO OFF
cd "{parameter “baseFolder”}"
rem // See comments at the beginning of this action for an explanation of the comment markers.
echo %DATE% %TIME% >> "{parameter “logFolder”}{parameter “logFile”}"
echo Action ID: {id of active action} >> "{parameter “logFolder”}{parameter “logFile”}"
rem //**Begin Command Marker
echo Command: “Teams_Windows_x64.bat” /s >> "{parameter “logFolder”}{parameter “logFile”}"
set errorlevel=
“Teams_Windows_x64.bat” /s >> “{parameter “logFolder”}{parameter “logFile”}” 2>&1
set SWDExitCode=%errorlevel%
rem //**End Command Marker
move __createfile run.bat
// You will not be able to stop or take action on an applicable BigFix Client until your installer completes.
// So ensure no user input is required.
// If your package absolutely must interact with the user, replace ‘override wait’ with ‘override run’ and ‘wait’ with ‘run’.
override wait
hidden=true
completion=job
wait run.bat
//**Begin Closing Marker
// Get the return code of the previous action.
parameter “returnCode” = “{exit code of action}”
// Task will now exit.
exit {parameter “returnCode”}
//**End Closing Marker
MS Teams is the above log file. It shows up in process on the client side that it’s there but for some reason it doesn’t finish the installation. On the BigFix console it shows “running” without completion.
I have managed to deploy MS Teams without the .bat file successfully. I deployed with the .msi file, and found out with MS Teams the user needs to log out and back in again after the BigFix task has completed in order for the installation to start running. Thereafter the installation completes successfully… The logging in and out is what I was not aware of.