As an Admin you can restrict access to PowerShell and what can run.

With a simple command you can view the execution policy set on a server:

  • Get-ExecutionPolicy
Powershell:- check vm replicas using simple commands.

As shown above, it is set to unrestricted on this server.

To change it to restricted as an example you can run the following command in PowerShell:

  • Set-ExecutionPolicy restricted

And then confirm the change.

Hope it helps.

Discover more from Everything-PowerShell

Subscribe now to keep reading and get access to the full archive.

Continue reading