1

Let's say my windows login is "brian". And I have a second account "brian-admin". I am logged in as "brian". And I run Powershell via "Run as administrator" with "brian-admin". Now if I install programs from the command line which profile are they installed to, brian or brian-admin?

Let's just say I installed NVM via:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Now, similar scenario. I am still logged in as "brian". I run Powershell as administrator. Then I use runas "brian" to install an application. Will this application be installed with administrative rights? Which profile does this application get installed to?

Fundamentally, I am asking if this idea of having 2 accounts is natively supported by Windows? I'm accustomed to having 1 account "brian" that either has or does not have admin rights. In combination w/ UAC which has sort-of 2 modes. A normal token and an admin mode token. Not aware of any such mode where 2 accounts are involved.

UPDATE

To clarify, I want to know the process to install apps to "brian". I never login to "brian-admin" only brian. Yet, all my software developer apps require elevation at least for installation (Visual Studio, SQL Server Management Studio, NVM, Node, ETC...).

P.Brian.Mackey
  • 2,120
  • 6
  • 28
  • 36
  • Apps install per machine by default when installed by admins and per user when installed by users. Type `runas /?` for you answer. `/profile specifies that the user's profile should be loaded. This is the default.` – user1644677 Jan 04 '22 at 02:34

1 Answers1

1

Yes. You can certain have standard and admin accounts on the same Windows System. This is done all the time.

brian and brian-admin are two different accounts with two different user profiles.

And I run Powershell via "Run as administrator" with "brian-admin". Now if I install programs from the command line which profile are they installed to, brian or brian-admin?

As you wrote the above, and if starting from brian, the powershell app (program) will be installed to brian. UAC will challenge for correct credentials.

And per your Update, if you always use brian, installations are always to brian. The vast majority of installations require admin credentials and that will be the case here.

If using brian-admin - then it asks OK. If doing an install from brian-admin, it installs to brian-admin.

When using brian it asks for user id and password because brian is a standard user.

Fundamentally, I am asking if this idea of having 2 accounts is natively supported by Windows? I'm accustomed to having 1 account "brian" that either has or does not have admin rights.

Yes, this is natively supported in Windows. XP all the forward to Window 10 and 11.

A Standard user uses default UAC and will be challenged for credentials (admin userid and password) for any installation of a program.

An Admin user has the range of UAC settings allowed. I use the basic setting where UAC asks OK to proceed and dims the screen.

Two accounts on a business system (user and the company Admin) are completely ordinary and used in many businesses.

So in summary and simplified:

(A) A Windows operating system can have both Standard and Administrative Users. True from Windows NT and forward for all Windows operating systems.

(B) When a user installs software, that software will be installed for the user. (Sometimes All Users).

(C) If a user installing software is a Standard User, the user will be challenged for admin user id and password.

If a user installing software is an Administrative user, the user will be asked if it is "OK"

John
  • 46,167
  • 4
  • 33
  • 54
  • There is a piece missing from this answer that I was really chasing for this question. If I want to install an app (rather it's many apps) to "brian" and all these apps require elevation, then how do I do it? I do NOT use "brian-admin" to run any such app. – P.Brian.Mackey Jan 04 '22 at 01:25
  • Yes - I corrected my post. UAC will challenge for correct credentials. If using brian-admin just OK, If using brian, admin user id an password. I just overlooked credentials and clarified. – John Jan 04 '22 at 01:30
  • OK, so are you saying that if I am prompted for credentials and I enter "brian-admin" then it will still install to "brian" NOT "brian-admin" right? If that's the case then that mostly answers the question. Just not in cases where credentials are not requested. I don't like the idea of installing software using a standard account and hoping it doesn't fail silently. – P.Brian.Mackey Jan 04 '22 at 01:30
  • Yes, if you start from brian and power shell installs, the install will be to brain. just like an app install. I had to re-read the question a couple of times. Installation of an app in any standard user requires admin credentials. – John Jan 04 '22 at 01:33
  • I further clarified for you updated question – John Jan 04 '22 at 01:40
  • 1
    I don't like the idea of installing software using a standard account and hoping it doesn't fail silently. .... I have not seen that happen as Windows will always ask – John Jan 04 '22 at 01:47