question

yannara avatar image
1 Vote"
yannara asked SteveHohenstein-3082 edited

Teams sign-in automatic but hide on a background - automation

I am very surprised, that still there is no official way to control Teams client that it will sign in automatically but not will launch on a first screen. Missing of this leads to bad user experience. In client ui there is such option, but there is no way to automate this via GPO, Intune or Registry. Problem is, that after logon to the Windows desktop, user typically starts something else, maybe providing credentials to the web app, or opens Outlook and starts typing, and all of the suddent -teams launches on a full screen and in worst case scenario you see typing your password on Teams chat or channel by accident. There is a GPO to disable automatic start up, but it will also stop to logging in, which is bad.

Yea I know that there is a uservoice, nothing has happend there and it will become exctingt in a some time ...

office-teams-windows-itprooffice-itprooffice-deployment
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ZhengqiLou-MSFT avatar image
0 Votes"
ZhengqiLou-MSFT answered ZhengqiLou-MSFT edited

Hi @yannara ,

Yes, for now I couldn’t find the official documents about using GPOs or Registry to control the Teams clients to startup in background. I did a research about it and tried something that maybe helpful, here are what I’ve done:

I tried using the following methods and Failed:

  1. Add suffix --process-start-args "--system-initiated" to the target box of the Teams shotcut.

  2. Add the Registry: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] > "com.squirrel.Teams.Teams" = "C:\Users\XXX\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe" --process-start-args "--system-initiated""

  3. Add the Registry: [HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run] > "com.squirrel.Teams.Teams" = "C:\Users\XXX\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe" --process-start-args "--system-initiated""


I could run this command in PowerShell to enable the open application in background option:

 (Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace('"openAsHidden":false', '"openAsHidden":true') | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json

I think you may use this command and spread it out of your organization.

Here is the topic in UserVoice, we could vote on this. Some new features would be added to the services based on customers' feedback in the future, and your good ideas will be very helpful for them to improve the service.

Best regards,
Lou


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ZhengqiLou-MSFT just to make sure, are you saying that those regs had 0 affect but the PS1 worked? I forgot to mention, that I also did test with registery and there was 0 affect. Thanks!

2 Votes 2 ·
yannara avatar image
1 Vote"
yannara answered EdHixon-1585 commented

@ZhengqiLou-MSFT after executing that PS1 successfully in user session and rebooting computer, with new login Teams pop-up just before, no change...

119539-image.png



image.png (40.7 KiB)
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @yannara

Yes I tried the Regs and no use.

And the ps1 would work only when the Teams client is not started. After run it, the option, Open application in background will be set to enable.

Best regards,
Lou

0 Votes 0 ·

Hi @yannara

Do the suggestions above help? If the issue has been resolved, please click “Accept as answer” to mark the helpful reply as an answer, this will make answer searching in the forum easier and be beneficial to other community members as well.

If you are still stuck in this issue, please feel free to post your questions.

Regards,
Lou


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



0 Votes 0 ·

@ZhengqiLou-MSFT I did execute the script via Intune for user session, so during autopilot / or right before that th script is executed. With that, Teams still pops-up on a full screen.

0 Votes 0 ·
Show more comments
MarioVeras-4431 avatar image
1 Vote"
MarioVeras-4431 answered MarioVeras-4431 commented

It seems that this Powershell code is incorrect. I have executed it multiple times, examined the contents of the desktop-config.json file and it is identical. When I change the values manually from false to true and viceversa, they stay and the desired outcome is achieved. However, when invoking the powershell command, as written, it makes no changes to the json file. There are no errors when executing the Powershell command. However, I do observe that the timestamp of the json file changes, which leads me to believe it is touching the json file in some way, but it is definitely not making the expected change to the json file.

I am making sure that Teams is not running while running the Powershell command. If Teams is running, it will automatically reverse any changes to the json file, so Teams must be closed before making changes to the json file.

 (Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace(‘”openAsHidden”:false’, ‘”openAsHidden”:true’) | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I believe I found the issue: it's the quotes! Before executing the powershell code, make sure to delete and retype the single and double quotation marks around '"openaAsHidden":false', '"openaAsHidden":true' otherwise the copy and paste from the web is going to play dirty tricks on you.

1 Vote 1 ·

@MarioVeras-4431 I believe this is correct, right?

(Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace('"openAsHidden":false', '"openAsHidden":true') | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json

1 Vote 1 ·

Hi @yannara and @MarioVeras-4431 ,

Yes as Mario said, the quote marks are totally different:
127467-image.png
The first one is what it should be while the second one is what I gave above.

So sorry about this, I guess this maybe a copy mistake:(

Best regards,
Lou

1 Vote 1 ·
image.png (18.0 KiB)
Show more comments

Yes, yannara that seems correct.

1 Vote 1 ·
yannara avatar image
1 Vote"
yannara answered

Hmm, I started to noticing today that this script is actually working. Maybe it is Autopilot processing with powershell which may vary the result, but I see first computer with desired settings. I haven't change anything regarding this for few weeks.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SteveHohenstein-3082 avatar image
0 Votes"
SteveHohenstein-3082 answered SteveHohenstein-3082 edited

Sorry for posting on an old thread, but in case this helps someone in the future I figured out which reg-key adds in the auto-starting feature for Teams. This changes the disabled / enabled toggle in Task Manager.

Not entirely sure what the Powershell equivalent is, but here's what I have added to our logon script:

 REG ADD  "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "com.squirrel.Teams.Teams" /t REG_BINARY /d "020000000000000000000000" /f >null 2>null

Conversely, if you'd like to disable something from startup, change the hex to this:

 030000004655C8020E54D801




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.