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 22.214.171.12476 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
Apr 12 2022 02:12 PM
@ericw190 I'm looking for something a bit simpler.
All I want to do are basic command line switches like "start a chat with this person" or "call this person" from the Run prompt in Windows.
For Outlook, this is really simple. Here's an example for starting an email from the Run prompt:
outlook.exe /c ipm.note
I would like to do the same for Teams, but there is no published documentation on actual command line switches. Just the shortcuts that people can type manually in the search window of the actual application, like: /call
I want the ability to start a call with someone, or start a new message, without being in the Teams app at that particular time.
Can this be done?
Apr 12 2022 08:07 PM
Apr 13 2022 09:35 AM
@AnqB0VVRJMzsO6zV whoa, those "deep links" look really powerful. I've already tinkered with them, and have been able to use them to queue up messages to send to certain people, or even video call someone, directly from the Run menu. Much obliged!!
Apr 20 2022 01:39 AM
@jholzbau "start a chat with this person" can still be done with the oldschool:
But the deeplinks doc looks really promising. Did you also use them on teams.exe directly or with start msteams: or other the web-link ?
Apr 21 2022 01:14 PM
@AnqB0VVRJMzsO6zV I have figured out how to jump directly to a channel from the Run menu -- thank you.
Here is where I'm struggling now, though. My weekly team meeting has a lively chat that continues in perpetuity. We chat during the meeting, and we keep chatting until the next meeting, and so on. We don't actually choose the channel for discussion....we use the Chat for the actual recurring meeting, which presents to me as just another chat thread.
I'm able to jump to various chat threads with the deep links (e.g. msteams:/l/chat/0/0?users=[list of email addresses]&topicName=[chat thread name]. But I can't use that same method to jump to the "chat" of a recurring teams meeting. I assume because what I'm passing via deep link is the list of users and the name of the thread, but *not* the actual meeting ID.
Is there a way to pass the meeting ID into this, so that I can quickly jump to the "chat" for the meeting? Something like this, perhaps?
msteams:/l/chat/0/0?users=[list of email addresses]&topicName=[chat thread name]&meetingID=[meeting ID]
Apr 21 2022 10:47 PM
Apr 27 2022 09:08 AM - edited Apr 27 2022 09:23 AM
Yeah Nice! True these call work directly from Run dialog.
Another awesome benefit over the sip:-method is that we can simply add chat members like so:
Apr 27 2022 09:22 AM
Since I call from Python eventually I was unable to use these calls without a path of teams.exe. (which is a solved problem ...) But I thought there was something to put on the Python subprocess.call() to make this work?
Was it .call(['start', cmd]) :thinking_face:
Just prepending start works in a command line window no problem but not from subprocess.call().
What works there is getting os.getenv('COMSPEC') and calling it all together like:
subprocess.call([os.getenv('COMSPEC'), '/c', 'start', cmd])
But it pops a command line window for a splitsecond and seems a bit weird that it doesn't work simpler? Any Ideas?
(I know how to solve the command line window popping but that makes it even longer)
May 02 2022 01:13 PM - edited May 02 2022 01:14 PM
Oooh really?! pcheew. Well, If you want to know: there is also a python only way to do this. It's just 3 more lines:
startup_info = subprocess.STARTUPINFO() startup_info.wShowWindow = subprocess.SW_HIDE startup_info.dwFlags |= subprocess.STARTF_USESHOWWINDOW subprocess.call([com, '/k', 'start', cmd], startupinfo=startup_info)
where com is like com = os.getenv('COMSPEC') and cmd your msteams-call.
Oh! you put the /k there! Hmm. Also good. As the command is moving things into a thread and then returns it probably doesn't matter. But yea: it's probably better in case it does not return!