Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet

While trying to add a new user to grant PowerShell script execution policies, I got this error message:

Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet

Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet

Solution:

Although you are in the local server Administrator group, You must run the SharePoint Management Shell as Administrator. Simply right-click on SharePoint 2010/2013 Management Shell  >> Choose “Run as an administrator”!

Alternatively, you can disable the UAC to avoid these kinds of issues. You may face this issue when you try to run cmdlets such as: Add-SPShellAdmin, Backup-SPFarm, New-SPWebApplication, Set-SPManagedAccount, etc.

Related article: How to disable UAC in Windows 2012?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

One thought on “Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet

  • Cannot add Administrator to the SharePoint_Shell_Access role of the database SharePoint_Config. A possible cause
    of this error is that the account name was already added to the database as a login using a different user name than
    the account name

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *