Bigfix is copying a batch file on the target PCs and executing it.
The batch file launches a browser for users to register their PC with us…
Looks like that:
@echo off
setlocal ENABLEDELAYEDEXPANSION
set url=https://myurl.mycompany.com/index.php?mac=
for /f “delims=,” %%a in (‘getmac /fo csv /nh’) do (
set mac=%%a
set url=!url!!mac!,
)
:: remove trailing comma
set url=!url:~0,-1!
set url=!url!^&comp=!computername!^&user=!username!
start “” !url!
That web page then returns all sort of info on the registered machines, including user name, mac address, properties.
Works perfectly via BF when the user is a local admin, and we run it as current user. But when the user is not a local admin, depending on the scenario (where we run the batch file from, _download or copy it to a local folder) it either won’t launch the browser or will not return the Mac address - it returns everything else…
when the file is created (download, appendfile, createfile - whatever) it’s created beneath __BESData
Based on that folder’s permissions, standard users get no access rights. If you then move the file, it retains the original permissions. You may need to use copy so that new permissions are created based on the permissions of the target folder.
All good suggestions, thanks ! What I ended up doing was splitting that script into 2. It was having issues with what was being done under the system account vs under current user. So now I’m dropping the batch files (plural) locally and executing #1 - the loop bit that collects the MACs. It outputs to a text file. Then I switch to “run as current user” and get current user profile stuff (user name and machine), and input the MAC file, build the complete url, and launch IE as current user (launching as “system” does not work). This should work better - it works on my test machines but only a bigger field test will tell me for sure