Install fails on WIn 11
Closed this issue ยท 20 comments
Trying to install this on Win 11:
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\scripts\Install.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): r
Stop-Service : Cannot find any service with service name 'Microsoft Teams Status Monitor'.
At C:\scripts\TSFunctions.ps1:2 char:5
+ Stop-Service -Name "Microsoft Teams Status Monitor"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft Teams Status Monitor:String) [Stop-Service], ServiceCommandEx
ception
+ FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StopServiceCommand
Can't open service!
OpenService(): The specified service does not exist as an installed service.
Service "Microsoft Teams Status Monitor" installed successfully!
Please enter the password for user jimmy: ****************
Set parameter "ObjectName" for service "Microsoft Teams Status Monitor".
Start-Service : Service 'Microsoft Teams Status Monitor (Microsoft Teams Status Monitor)' cannot be started due to the
following error: Cannot start service Microsoft Teams Status Monitor on computer '.'.
At C:\scripts\Install.ps1:28 char:1
+ Start-Service -Name "Microsoft Teams Status Monitor"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
Appears it doesn't like my credentials
I have the same issue running Windows 11. Just to make sure, are you also in an AzureAD domain?
I have the same issue running Windows 11. Just to make sure, are you also in an AzureAD domain?
Using a Microsoft account, so likely yes.
I have the same issue running Windows 11. Just to make sure, are you also in an AzureAD domain?
Using a Microsoft account, so likely yes.
Can you try this #9 (comment) and see if it works? Or at least replace it with the value in your USERDOMAIN environment variable manually?
Ok finally getting around to looking at this a bit, I do not have Win11 unfortunately, if we can't figure it out with some back and forth I'll see about getting a VM up.
What does your Services.msc show for the service Microsoft Teams Status Monitor?
Mine looks like this:
Since the installation of the service seems fine (I think) it might be something else (it could be what @buhito81 found).
What user is showing up under "Log On As" in Services.msc?
Is it AzureAD\yourusername?
I'm also experiencing this issue with a Windows 11 machine but a personal Microsoft account.
I have finally gotten a Win11 VM up and running, I'll work on replicating and hopefully finding a solution to this problem over the next week or so.
I am using a Live account to log in (on Windows 11) and by default the installer will use the local account which Windows creates, so in my case it shows up as '.\antoi' in the services.msc and it works fine.
I did have to run the additional commands prior to running Install.ps1 though as explained by another user on the other open issue:
- Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
- Unblock-File .\Settings.ps1
- Unblock-File .\Get-TeamsStatus.ps1
I do not have an AzureAD account so what I can test is limited, I was counting on the fact that a Microsoft account would have the same problems for me.
If you run it under Local System account does it help?
- Right click on the entry in the Services.msc app
- Properties
- Log On tab
- Check the Local System account
- Apply or OK
- Then try to start the service again
Edit: I have very little hope on that Local System account, it fails on my end when I do it...
I tried it again with the Live account and it goes straight to a paused status. Switching it to the Local System account did the same thing.
Do you have a local account as a test?
I don't know if the nssm thing has the possibility of logging, I'll have to research it.
Apologies @AntoineGS it does work. I was using the newer version of PowerShell and apparently Execution Policies are stored in different places depending on whether you are using the original PowerShell file vs PowerShell 7.0+. Once I set the execution policy in PowerShell it worked. If you need to add NSSM logging the suggestion proposed here https://stackoverflow.com/questions/38923227/how-to-fix-service-paused-error-on-starting-nssm-server should work.
Apologies @AntoineGS it does work. I was using the newer version of PowerShell and apparently Execution Policies are stored in different places depending on whether you are using the original PowerShell file vs PowerShell 7.0+. Once I set the execution policy in PowerShell it worked. If you need to add NSSM logging the suggestion proposed here https://stackoverflow.com/questions/38923227/how-to-fix-service-paused-error-on-starting-nssm-server should work.
So you have set the execution policy with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
?
I get the same Error but that does not help either.
@n7298174289 If you have installed PowerShell 7 and set it as default it stores its execution policy in a different location than the built-in PowerShell. If you are launching it from C:\Windows\System32\WindowsPowerShell\v1.0 here, you are using the built-in PowerShell. If you are using it from any other location such as C:\Program Files\PowerShell\7 here, you are using PowerShell 7. If you are still having issues, you could try setting the execution policy to being Unrestricted, but it is not recommended.
I get this error:
Failed to look up the SID for username .\x!
LsaLookupNames(): Er is geen toewijzing uitgevoerd tussen accountnamen en beveiligings-id's.
Failed to look up the SID for username .\x!
LsaLookupNames(): Er is geen toewijzing uitgevoerd tussen accountnamen en beveiligings-id's.
Failed to grant the "Log on as a service" right to account .\x!
Error setting parameter "ObjectName" for service "Microsoft Teams Status Monitor"!
Start-Service : Failed to start service 'Microsoft Teams Status Monitor (Microsoft Teams Status Monitor)'.
At C:\Scripts\Install.ps1:28 char:1
- Start-Service -Name "Microsoft Teams Status Monitor"
-
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
Can anyone help?
I found something that worked for me.
Instead of using a service or a task in Task Scheduler, I used a VBS file in the startup folder like this:
In C:\Scripts\
I created a new file called "Start.vbs" and put this in the contents:
Dim WShell
Set WShell = CreateObject("WScript.Shell")
WShell.Run "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Scripts\Get-TeamsStatus.ps1", 0
Set WShell = Nothing
This runs the PowerShell script in the background, and it appears as "Windows PowerShell" in Task Manager.
I then press Windows
+ R
and enter shell:startup
to open the startup folder. I create a shortcut with wscript C:\Scripts\Start.vbs
as the path and Start TeamsStatus
or whatever you want to call it as the name.
I restart and it started working perfectly. No command prompt window flashing or processes in the taskbar. Very clean and reliable.
I found something that worked for me.
Instead of using a service or a task in Task Scheduler, I used a VBS file in the startup folder like this:In
C:\Scripts\
I created a new file called "Start.vbs" and put this in the contents:Dim WShell Set WShell = CreateObject("WScript.Shell") WShell.Run "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Scripts\Get-TeamsStatus.ps1", 0 Set WShell = NothingThis runs the PowerShell script in the background, and it appears as "Windows PowerShell" in Task Manager.
I then press
Windows
+R
and entershell:startup
to open the startup folder. I create a shortcut withwscript C:\Scripts\Start.vbs
as the path andStart TeamsStatus
or whatever you want to call it as the name.I restart and it started working perfectly. No command prompt window flashing or processes in the taskbar. Very clean and reliable.
Thank you verry much! Seems to work atm.
Awesome thanks a lot!!!