Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AutoStart Functionality #1

Open
davidstan1234 opened this issue Dec 12, 2023 · 7 comments
Open

Add AutoStart Functionality #1

davidstan1234 opened this issue Dec 12, 2023 · 7 comments

Comments

@davidstan1234
Copy link

Teams will not auto run automatically for NEW User Profiles after teams was installed. Commonly in new build or bare metal scenarios, the system account is instlling teams and before a user logs in. Enabling this key should force teams to auto start after installation for any NEW users that login to the machine. This is helpful for bare metal builds. This is a work in progress, but it should be something like this:

Reg.exe load HKLM\DefaultUser C:\users\default\NTUSER.DAT
$RegItem = @{
Path = "HKLM:\DefaultUser\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams_8wekyb3d8bbwe\TeamsTfwStartupTask"
Name = "State"
Value = "2"
}

#Enable MSTeams first time startup for all default users
$Path = Get-Item -Path $RegItem.Path -ErrorAction SilentlyContinue
If ($null -eq $Path) {New-Item -Path $RegItem.Path}
New-ItemProperty $RegItem.Path -Name $RegItem.Name -PropertyType DWORD -Value $RegItem.Value -Force
reg.exe unload HKLM\DefaultUser

Possibly create a new switch parameter along the lines of "SetAutoStart"

@suazione
Copy link
Owner

Just did a quick check and it seems as if ..\MSTeams_8wekyb3d8bbwe RegKey gets overwritten when a new user logs in.
I just tested to create RegLey and Value for DefaultUser, logging on with a new user and checking, the MSTeams_8wekyb3d8bbwe exists but not the TeamsTfwStartupTask key. If I start Teams manually that key gets created and State is set to 2 by default.
So I guess this would have to be added as a RunOnce key as well that the RegKey and value is created after login.

@suazione
Copy link
Owner

RunOnce will not work as that would set the RegValue too late, but even doing a quick test doing that didn't set the value (probably the key was overwritten).

@davidstan1234
Copy link
Author

Same, I have been unable to successfully get this to work. Will add some feedback in the app to Microsoft Devs and might open a case.

@AdamGrossTX
Copy link

AdamGrossTX commented Dec 23, 2023

I have been working on this as well and it appears that the new install creates the correct registry keys for the installing user, however autostart doesn't kick in unless either of these keys gets set.

Key: HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams_8wekyb3d8bbwe
Type: REG_DWORD
Name: WasEverActivated
Value: 1

Key: HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams_8wekyb3d8bbwe\TeamsTfwStartupTask
Type: REG_DWORD
Name: UserEnabledStartupOnce
Value: 1

@suazione
Copy link
Owner

@AdamGrossTX @davidstan1234 Did any of you find a working solution or workaround for this?
If I remeber correctly from testing this the last time those registry values got overwritten when MSTeams is started for the first time for the user and therefore gets overwritten.

@davidstan1234
Copy link
Author

@AdamGrossTX @davidstan1234 Did any of you find a working solution or workaround for this? If I remeber correctly from testing this the last time those registry values got overwritten when MSTeams is started for the first time for the user and therefore gets overwritten.

Unfortunately, no. There is a feature request with Microsoft but we have come to the conclusion that the user will need to launch Teams the first time for the autostart to kick in. I could not find a way around it.

@HorNet505
Copy link

HorNet505 commented Mar 19, 2024

just an idea. Use a user-context GPO to set the RUN ONCE for each user.
Or
Read out all users via PS and loop through:

# Get current location to return to at the end of the script
$CurLoc = Get-Location
New-PSDrive -Name HKU -PsProvider Registry HKEY_USERS -ErrorAction SilentlyContinue | out-null
Set-Location HKU:
$regProfiles = Get-ChildItem -Path HKU: | ? { ($_.PSChildName.Length -gt 8) -and ($_.PSChildName -notlike "*_Classes") }
ForEach ($profile in $regProfiles ) {

    *DO WHAT NEEDS TO BE DONE*
}
Set-Location $CurLoc
Remove-PSDrive -Name HKU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants