When PowerShell is installed, it sets the default execution policy to Restricted which allows commands to be executed, not scripts. I don’t think this is the best approach for the application since the scripting is the main reason why people would install and use PowerShell.
You can determine what the execution policy is with this command:
Get-ExecutionPolicy
There are 4 options for execution policy: Restricted, AllSigned, RemoteSigned, and Unrestricted. The last 3 options allow scripts to be run in the shell. I prefer using the RemoteSigned policy over AllSigned because it doesn’t require a digital signature from a trusted publisher to run scripts.
You can set the execution policy for running scripts with the following command:
Set-ExecutionPolicy RemoteSigned
Sorry but, I could not find what I was looking for exactly. I am looking for setting up a semi-administrative account to run powershell scripts and cmdlets which, can read information about all objects from domain controllers and its members but not WRITE anything or SET any attribute or delete an object. If anyone can help me with setting up such permissions on the domain user account would be of a great help.