You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ARSO option to Restart-Computer and Stop-Computer cmdlets #14222
Add a switch parameter to the existing cmdlets that enable the ARSO option for shut down or restart of a Windows system. Use "EnableARSO" or "ARSO" as the switch parameter name.
Reacted by Michael Klement, Josh King and Stephen Valdinger
This is PowerShell, with Tab Completion... as a user I have no idea what ARSO means and would much rather the switch be "Auto(matic)RestartSignOn" or something equally verbose and descriptive
Reacted by Steven Judd, James Ruskin and Noah Sherwin
The public API (for Windows) that I know of is the AutoLogon registry keys https://docs.microsoft.com/en-us/troubleshoot/windows-server/user-profiles-and-logon/turn-on-automatic-logon. One big disadvantage of this is the password is encoded either in plaintext or in a reversible format. The plaintext option is the easiest as it's literally just setting the registry keys, the "encrypted" option is a lot more complicated and requires some PInvoking to call the LSA functions required to get the encrypted data to store in the registry. This is what I've done in Ansible to create the encrypted data which is then stored in the registry key.
While encrypted it is still reversible by any admin on that host so we should definitely be documenting this limitation.
Jordan Borean (@jborean93) I guess we cannot use this for security reasons. While PowerShell makes good use of the OS's capabilities, it remains secure as long as the OS is secure.
The only option is if MSFT makes ARSO public in Windows SDK.
The only option is if MSFT makes ARSO public in Windows SDK.
I'm not sure how that would change the security aspects of this functionality. For Windows to log automatically it would need to access your password which means however it is stored it needs to be reversible. There are ways to limit this by making it encrypted and only reversible by admins on the host. Even if it was exposed as an API in Windows the end result will be the same, there are just less steps for us to take.
I'm neither +1 or -1 on this feature. I can only talk about the Windows side of things and mention that this has some security risks but there are ways to slightly mitigate them.
Jordan Borean (@jborean93), I think the security risks are assumed. The goal is to enable the same level of functionality available to shutdown.exe to the Restart-Computer and Stop-Computer cmdlets. This would allow someone to be able to get the expected functionality from PowerShell where as it stands now they must use shutdown.exe to get the functionality.
After thorough debate, the cmdlet WG concluded:
A platform-specific feature for which a native command exists generally is easily accessible from within PowerShell as-is. For example, it is trivial on a Windows system to use shutdown.exe in a PowerShell script.
Using native commands may not be easily discoverable, though: the PowerShell help system wouldn't suggest this native command or provide help. This part could indeed be solved by adding the functionality to a core cmdlet.
On the down side, this would decrease consistency and user experience on non-targeted systems though.
So for platform specific features, the cmdlet WG recommends to continue to directly use appropriate native commands provided by the particular platform on the platforms where it is available. If additional PowerShell-specific functionality like risk mitigation (-whatif) etc is needed - native commands can easily be wrapped inside a PowerShell function.
For these reasons, the issue was closed, and we hope our reasoning resonates with the community.
Activity
Windos commentedon Nov 22, 2020
This is PowerShell, with Tab Completion... as a user I have no idea what ARSO means and would much rather the switch be "Auto(matic)RestartSignOn" or something equally verbose and descriptive
steviecoaster commentedon Nov 22, 2020
I'll see what I can do with this this week.
iSazonov commentedon Nov 23, 2020
We need a public API to implement this. Do you know such API?
jborean93 commentedon Nov 23, 2020
The public API (for Windows) that I know of is the AutoLogon registry keys https://docs.microsoft.com/en-us/troubleshoot/windows-server/user-profiles-and-logon/turn-on-automatic-logon. One big disadvantage of this is the password is encoded either in plaintext or in a reversible format. The plaintext option is the easiest as it's literally just setting the registry keys, the "encrypted" option is a lot more complicated and requires some PInvoking to call the LSA functions required to get the encrypted data to store in the registry. This is what I've done in Ansible to create the encrypted data which is then stored in the registry key.
While encrypted it is still reversible by any admin on that host so we should definitely be documenting this limitation.
iSazonov commentedon Nov 23, 2020
Jordan Borean (@jborean93) I guess we cannot use this for security reasons. While PowerShell makes good use of the OS's capabilities, it remains secure as long as the OS is secure.
The only option is if MSFT makes ARSO public in Windows SDK.
jborean93 commentedon Nov 23, 2020
I'm not sure how that would change the security aspects of this functionality. For Windows to log automatically it would need to access your password which means however it is stored it needs to be reversible. There are ways to limit this by making it encrypted and only reversible by admins on the host. Even if it was exposed as an API in Windows the end result will be the same, there are just less steps for us to take.
I'm neither +1 or -1 on this feature. I can only talk about the Windows side of things and mention that this has some security risks but there are ways to slightly mitigate them.
iSazonov commentedon Nov 24, 2020
It is very sensitive area. It is a common rule to delegate such things to OS. If a security hole is found, it will be fixed there.
stevenjudd commentedon Jan 26, 2021
Jordan Borean (@jborean93), I think the security risks are assumed. The goal is to enable the same level of functionality available to shutdown.exe to the Restart-Computer and Stop-Computer cmdlets. This would allow someone to be able to get the expected functionality from PowerShell where as it stands now they must use shutdown.exe to get the functionality.
TobiasPSP commentedon Oct 14, 2021
After thorough debate, the cmdlet WG concluded:
A platform-specific feature for which a native command exists generally is easily accessible from within PowerShell as-is. For example, it is trivial on a Windows system to use shutdown.exe in a PowerShell script.
Using native commands may not be easily discoverable, though: the PowerShell help system wouldn't suggest this native command or provide help. This part could indeed be solved by adding the functionality to a core cmdlet.
On the down side, this would decrease consistency and user experience on non-targeted systems though.
So for platform specific features, the cmdlet WG recommends to continue to directly use appropriate native commands provided by the particular platform on the platforms where it is available. If additional PowerShell-specific functionality like risk mitigation (-whatif) etc is needed - native commands can easily be wrapped inside a PowerShell function.
For these reasons, the issue was closed, and we hope our reasoning resonates with the community.
iSazonov commentedon Oct 14, 2021
Since it (ARSO) is public API it could be new cmdlet in a custom public project.