Windows server 2016 - non admin user run powershell as administrator

Jack Chuong 856 Reputation points
2021-10-20T10:02:52.753+00:00

Hi all,
My environment : Windows server 2016 standard with OpenSSH service running , a local user "gitlab" , user gitlab can ssh to server successfully.
I want user gitlab can do
Stop-WebAppPool -Name "mywebapppool" -Passthru
Start-WebAppPool -Name "mywebapppool" -Passthru
I granted user gitlab permission for managing IIS by using "IIS Manager permissions"
I added user gitlab into local Administrators group
It works.
Is there any other way that I don't have to add user gitlab into local Administrators group ?
I want user gitlab can run some WebAdministration cmdlet (or some .ps1 file) as administrator privilege
Please give me some advice, thank you very much.

Internet Information Services
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,368 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,354 questions
{count} votes

Accepted answer
  1. Limitless Technology 39,336 Reputation points
    2021-10-21T09:50:41.29+00:00

    Hello JackChoung

    What I would recommend you in this case is the use of JEA:

    Just Enough Administration (JEA) is a security technology that enables delegated administration for anything managed by PowerShell. With JEA, you can:

    Reduce the number of administrators on your machines using virtual accounts or group-managed service accounts to perform privileged actions on behalf of regular users.
    Limit what users can do by specifying which cmdlets, functions, and external commands they can run.
    Better understand what your users are doing with transcripts and logs that show you exactly which commands a user executed during their session.

    You can find more information about JEA, requisites and capabilities and usage here: https://learn.microsoft.com/en-us/powershell/scripting/learn/remoting/jea/overview?view=powershell-5.1

    -------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 44,621 Reputation points
    2021-10-20T14:18:25.487+00:00

    Have a look at this: overview

    1 person found this answer helpful.