How to run powershell commands without admin rights? Is there any option we can use and achive this?

Vinod Survase 4,746 Reputation points
2021-08-31T12:22:50.583+00:00

How to run PowerShell commands without admin rights? Is there any option we can use and achieve this?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,290 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,549 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,666 Reputation points
    2021-08-31T14:43:28.827+00:00

    Hello Vinod,

    If your domain administrator hasn't forbidden it, you can do this:

    Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser

    If you instead want to change the execution policy for just the current PowerShell session, you can use this command:

    Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

    However, if your domain administrator is using the "Turn on Script Execution" group policy, you will not be able to change your execution policy at all. The group policy setting makes the Set-ExecutionPolicy cmdlet ineffective.

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    Thanks,

    4 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Leon Laude 85,816 Reputation points
    2021-08-31T13:11:51.837+00:00

    Hi @Vinod Survase ,

    This may depend on your organization's policies, have a look here for a few options on how to run PowerShell commands without admin rights:
    How do I run powershell scripts without admin rights?

    ----------

    If the reply was helpful please don't forget to upvote and/or accept as answer, thank you!

    Best regards,
    Leon

    1 person found this answer helpful.

  2. Limitless Technology 39,666 Reputation points
    2021-09-02T08:25:38.727+00:00

    Hello Vinod,

    Unfortunately it seems that the issue here is not with Script execution but also with the Basic Authentication settings on your tenant. Basic Authentication seems to be disabled from what is written in the output.

    Not an expert in O365 or scripting to cloud services but I would suggest to check the tenant policies about Basic Authentication, and check by enabling 1 by 1 which is the one that is blocking the execution.

    https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/disable-basic-authentication-in-exchange-online
    In the part: Authentication policy procedures in Exchange Online

    Hope that helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.