Highlighted
Posted by OESTech
Henagon

MacOS command line not passing %COMPUTERNAME%

Hi,

I've managed to get the custom host installed on MacOS remotely using Jamf.  The second part is using command line to associate it with our group, enable remote access, and name the alias.  I'm using the example direct from the teamviewer web site on how to do this.  The command is:

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group "Some Group" -alias %COMPUTERNAME% -grant-easy-access 

Everything works except for the "-alias %COMPUTERNAME%" switch.  This computer gets added to my group with the name %COMPUTERNAME%.  Does anyone have a solution for this?

Capture.JPG

2 Replies
1 Accepted Solution

Accepted Solutions
Posted by OESTech
Henagon
Solution

Re: MacOS command line not passing %COMPUTERNAME%

Thanks Scotty,  I also found out from support that computer name is the default behavior.  So once I removed the switch it works anyway.

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group "Some Group" -grant-easy-access 
2 Replies
Posted by Senior Moderator Senior Moderator
Senior Moderator

Re: MacOS command line not passing %COMPUTERNAME%

Hi @OESTech 

Thanks for posting.

I found where you copied the error from our Command Line Parameters article
This has been corrected and I am sorry for the confusion.

This section of the script is not something set by TeamViewer.
This is a variable and how it is written depends on what you are using to run it.
%COMPUTERNAME% is an environment varible used in Windows command line.

In OSX, you are probably looking for a '$' variable.
Examples:
$USER
 - will use the username of the person currently signed in
$HOSTNAME - Uses the current device name

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group "Some Group" -alias $HOSTNAME -grant-easy-access 

I hope this resolves this for you.

All the best,
Scotty

Senior Moderator
Did my reply answer your question? Why not accept it as a solution to help others?
Posted by OESTech
Henagon
Solution

Re: MacOS command line not passing %COMPUTERNAME%

Thanks Scotty,  I also found out from support that computer name is the default behavior.  So once I removed the switch it works anyway.

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group "Some Group" -grant-easy-access