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

Pavel yannara Mirochnitchenko 12,606 Reputation points MVP
2021-07-29T15:04:09.52+00:00

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 ...

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,311 questions
Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
2,174 questions
0 comments No comments
{count} vote

Accepted answer
  1. Xzsssss 8,881 Reputation points Microsoft Vendor
    2021-07-30T05:08:35.533+00:00

    Hi @Pavel yannara Mirochnitchenko ,

    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.


7 additional answers

Sort by: Most helpful
  1. Pavel yannara Mirochnitchenko 12,606 Reputation points MVP
    2021-07-31T05:01:48.873+00:00

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

    119539-image.png

    1 person found this answer helpful.

  2. Mario Veras 41 Reputation points
    2021-08-24T17:12:51.87+00:00

    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
    
    1 person found this answer helpful.

  3. Pavel yannara Mirochnitchenko 12,606 Reputation points MVP
    2021-08-30T14:22:54.51+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

  4. Steve Hohenstein 1 Reputation point
    2022-04-28T15:26:59.413+00:00

    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
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.