Sep 21 2021 09:58 AM
Sep 21 2021 09:58 AM
Hello! So in our custom tools we try to give quick access to the responsible people. Its already possible to chat with co-workers in Teams with a click. In the background: getting the executable from `LOCALAPPDATA` + \Microsoft\Teams\current\Teams.exe works pretty reliable then just call this with `sip:firstname.lastname@example.org` and Voilà we chat!
Now I'd like users to be able to goto public channels with a click. I can get a link with Get link to channel. But running Teams.exe with this link does nothing! Just opens up the Teams main window with whatever was just open. No change.
I CAN just "run" this link with the webbrowser but then the user has to accept to always open the according links with MS Teams which is do-able but rather crude for some simpler users. And STILL one would have a useless web page open. Maybe the user doesn't even have a browser open... However it would be quite great to just go like:
What command line switch do I need?
Is there a list of command line switches? like the sip: one?
I'd love to do sth like Teams.exe /? or -help ...
btw: Currently there is a big fat ERROR msg when you do Teams on the console window:
Error while parsing hooks JSON. Error: "ENOENT: no such file or directory, open 'C:\\Users\\techarteric\\AppData\\Roaming\\Microsoft\\Teams\\hooks.json'" (node:17212) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Sep 23 2021 04:59 AM
Sep 28 2021 04:42 AM
@Meghana-MSFTI'm sorry I get the strong feeling that my post was not read :| ok... commands
main issue: Command Line args to goto channels directly?
The main "command" I'm using is Teams.exe the executable to run the Teams application on Windows.
So from another application I want to be able to run the Teams.exe with a command line switch to open a certain channel directly WITHOUT going over the browser.
Another "command" I'm using is the :link:Get link to channel option from a channel I want to link to.
Now just like one can do Teams.exe sip:email@example.com to chat directly with a given user
I'd like to be able to do something like Teams.exe channel:https://teams.microsoft.com/l/channel/19%3acb55... to open up Teams with the desired channel.
Of course this does not work. What "works" is opening the channel link with a browser. But ONLY if the user already enabled all the required checks to make the Browser entitled to do so. And then one still has a Browser open and a website which does not close on its own.
So I'm asking for a command line argument to make that happen!
OK. How can I search on my own: DuckDuckGo? Google? Bing? .. There seems to be nothing of value :\ sadly. Also the internal Help does not yield anything.
And finally like with any apps that do thing over the command line one can try "help" switches like: /? -help -h --help -? ... however nothing seems to work. All just open up the Teams app.
And whenever you do that ... also without ANY arguments the app will also print this DeprecationWarning to the console. Repro:
My version is 220.127.116.1176 at least that's the version detail on the executable.
Sep 28 2021 05:03 AMSolution
Alright I got it! the command line switch to do this is msteams:
I just took such a channel link, quit Teams from the sys tray, The browser opens it with the command I'm looking for and then it will still be on the command line args of the running Teams.exe! :sign_of_the_horns:
What I noticed is that the link is UBER long! In my case 345 characters.
The app actually complains about a LOT of stuff in there:
'tenantId' is not recognized as an internal or external command, operable program or batch file. 'deeplinkId' is not recognized as an internal or external command, operable program or batch file. 'launchAgent' is not recognized as an internal or external command, operable program or batch file. The system cannot find the file specified. 'directDl' is not recognized as an internal or external command, operable program or batch file. 'msLaunch' is not recognized as an internal or external command, operable program or batch file. 'enableMobilePage' is not recognized as an internal or external command, operable program or batch file. 'fqdn' is not recognized as an internal or external command, operable program or batch file.
So these can ALL be stripped off the link already and even groupId and type aren't needed!
One can even shorten off the name up to the slash like:
and that's all you need: convert %3a to : and %40 to @ , cut off after tacv2/ voilà!
If you'd like to store different channels: just take the ID between : and @ and use a template like
Sep 28 2021 05:31 AM
Another one. If you want to point to a message via command line and have it nicely highlighted this works very similarly:
So you can get rid of https://teams.microsoft.com/ in the front and all after ? in the end.
Turns out the ? at the end is important! Just like the / at the end of the channel template.
Oct 25 2021 04:15 AM
OK. Step by step:
Nov 03 2021 02:18 AM
@ericw190 thanks for the step by step documentation. Seems so that on private channels "get link to channel" is not available. On a non-private channel it works like you described it.
As well just with:
Nov 03 2021 10:37 AM