MSI Assignment Option with %computername% does not work
I have tried various options to install TeamViewer using MSI with the option to use the computername, and none have worked.
Here are the command that should work according to TeamViewer:
msiexec.exe /i "\\MyDomain\MyPath\TeamViewer_Host.msi" /qn APITOKEN=<YOUR_APITOKEN> ASSIGNMENTOPTIONS="--alias %COMPUTERNAME%"
This command works:
msiexec.exe /i "\\MyDomain\MyPath\TeamViewer_Host.msi" /qn APITOKEN=<YOUR_APITOKEN> ASSIGNMENTOPTIONS="grant-easy-access"
I have also tried many variations with quotes. It seems to be an issue with the the space after "--alias ".
Any help would be appreciated.
Best Answer
-
I found the issue.
Does not work in Powershell, only in CommandLine.
This works in CommandLine:
start msiexec /i "\\MyDomain\MyPath\TeamViewer_Host.msi" /qn CUSTOMCONFIGID=<MYConfigID> APITOKEN=<MYToken> IMPORTREGFILE=1 ASSIGNMENTOPTIONS="--reassign --alias ""%COMPUTERNAME%"" --group ""MyGroup"" --grant-easy-access"
I will have to try different methods to invoke this command from a Powershell script.
Thanks.
6
Answers
-
I found the issue.
Does not work in Powershell, only in CommandLine.
This works in CommandLine:
start msiexec /i "\\MyDomain\MyPath\TeamViewer_Host.msi" /qn CUSTOMCONFIGID=<MYConfigID> APITOKEN=<MYToken> IMPORTREGFILE=1 ASSIGNMENTOPTIONS="--reassign --alias ""%COMPUTERNAME%"" --group ""MyGroup"" --grant-easy-access"
I will have to try different methods to invoke this command from a Powershell script.
Thanks.
6 -
based on the manual they posted, you're supposed to use 'single quotation marks' when youre adding names with spaces inside of the "argument". Please try copy pasting the following:
start msiexec /i "\\MyDomain\MyPath\TeamViewer_Host.msi" /qn CUSTOMCONFIGID=<MYConfigID> APITOKEN=<MYToken> IMPORTREGFILE=1 ASSIGNMENTOPTIONS="--reassign --alias "'%COMPUTERNAME%'" --group "'MyGroup'" --grant-easy-access"
0 -
In PowerShell you need to use $env:COMPUTERNAME instead of %COMPUTERNAME% for the variable. You may also use the Start-Process cmdlet to execute MSIEXEC and pass all the options to it using the -ArgumentList parameter. Finally, try using the backtick character (` on the tilde key for US QWERTY keyboards) to escape the quotation marks in strings for PowerShell..
Example:
start-process -Wait msiexec -ArgumentList "/i `"\\MyDomain\MyPath\TeamViewer_Host.msi`" /qn CUSTOMCONFIGID=<MYConfigID> APITOKEN=<MYToken> IMPORTREGFILE=1 ASSIGNMENTOPTIONS=`"--reassign --alias `"$env:COMPUTERNAME`" --group `"MyGroup`" --grant-easy-access"
2