(13.2) Mass Deployment (COMPUTERNAME+USERNAME)
Hello.
When installing the bat.file I want to add clients to a group. And in that group I want the clients name to contain both Computername and Username.
I have tried using the parameter in assignoptions --alias %COMPUTERNAME+USERNAME% Result: PCxxxx+yyy (incorrect way)
Can I use a variable, something like "COMPUTERNAME" + " " + "USERNAME" = %NAME%
Comments
-
@mts-arkil Did you get anywhere with this, i need this function also
0 -
No not yet, I've been away from work for 10 weeks. Just got back.
I just add them manually afterwards, which I find to much time consuming. But at least we dont hire new staff so often, but I would really like to have this completly automated.
0 -
They advised username is not currently available as an option =(
0 -
This might be an old thread, but I have the second best solution.
Use this in a Batch script to grab username while under SYSTEM account. It finds the username of the running explorer.exe, which should always belong to an actual user (only works if a user is logged in, but might be unreliable if more than 1 user is logged in).
Code below:
:: Getting username for running explorer.exe process.
:: Will return empty string if no user is logged in (unreliable if more than 1 user is logged in)
for /F "tokens=8" %%i in ('tasklist /V /FI "IMAGENAME eq explorer.exe" ^| findstr "explorer.exe"') do set usern=%%i
for /f "tokens=2 delims=\" %%a in ("%usern%") do set usern=%%a
set compuser=%COMPUTERNAME% - %usern%
Now you've got the combined computername and username in %compuser% that you can paste in the parameter "--alias" 😊
1