microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.21k stars 6.54k forks source link

[Run] Add option to "Run as different user" #1605

Closed htcfreek closed 2 years ago

htcfreek commented 4 years ago

In the specification for power launcher I have seen an entry about adding "Run as admin" to the menu. Will there also bee a menu item to run an app as "different user"?

Why do I ask this: In our company we can't use the UAC. It is disabled and does not work. Wen have to run apps as different user to change into Admin kontext.

Idea from @Borkason

Added 03/11/2021

Have a second "run as different user" button where we can define the user in PT Run settings. (https://github.com/microsoft/PowerToys/issues/1605#issuecomment-796524117)

jyuwono commented 4 years ago

For v1, the team is focusing on implementing "run as admin" but "run as a different user" is a good suggestion! We can investigate and possibly add it in future versions.

crutkas commented 4 years ago

good idea, start menu can do this. image

danielniccoli commented 4 years ago

As shown with screenshots in #4038 the start menu can't do it in a lot of cases. Of which all of them are used daily by IT professionals. There is a GPO to enable it, but that mostly doesn't work either.

danielniccoli commented 3 years ago

There should be a setting to show or hide the Run as different user in the PT Run dialogs. And it should be disabled by default. I believe most people wouldn't need that option and this keeps the forms nice and clean for the majority of PowerToys users.

In addition to that, it would be great if we could have an option to add a second "run as different user" button to the form, that has a username preconfigured, so that I only need to enter the password of the preconfigured username. It would be important that only the username is stored, and the password must be entered every time. The use-case is that I have (as many admins do) a second Active Directory account that I use for many administrative tasks and it would be a great help if I would not have to enter the username every time I need to run an application as that user.

image

htcfreek commented 3 years ago

In addition to that, it would be great if we could have an option to add a second "run as different user" button to the form, that has a username preconfigured, so that I only need to enter the password of the preconfigured username. It would be important that only the username is stored, and the password must be entered every time. The use-case is that I have (as many admins do) a second Active Directory account that I use for many administrative tasks and it would be a great help if I would not have to enter the username every time I need to run an application as that user.

Love this great idea. Can completely agree. I had the same use case for this feature.

sourbrambles commented 2 years ago

+1 this would be invaluable for my work processes.

htcfreek commented 2 years ago

@crutkas This is an easy thing. Plan this for next release (0.58).

To trigger the other user behavior we have to create the Process.StartInfo object with a different verb: runAsUser (Run as admin command uses runAs as verb.)

I think this makes sense for Program plugin, Shell plugin and Search plugin.

htcfreek commented 2 years ago

@crutkas I don't think we should implement a setting for a button with predefined credentials. This might be a security risk.

The actual implantation (see my PR) show the Run as different user dialog like explorer does.

danielniccoli commented 2 years ago

I don't think we should implement a setting for a button with predefined credentials. This might be a security risk.

@crutkas Nobody said anything about credentials. Please read the suggestion again.

It would be important that only the username is stored, and the password must be entered every time.

crutkas commented 2 years ago

Let’s file the storing secondary user name as a different issue and we can revisit. I’d imagine terminal has had similar asks and IMO we should follow their philosophy

htcfreek commented 2 years ago

Sory I read the suggestion to fast.

This should indeed be a second issue as it imo require the centralization of the run as user code.

htcfreek commented 2 years ago

Cool that this is part of the hotfix. Didn't expect that.

htcfreek commented 2 years ago

Shipped with 0.58.0 (Hotfix for 0.57.2)