3

I joined a second web front end server following the instructions in this technet page.

When I had to perform this: Install-SPService

I got the following error:

Install-SPService : Exception has been thrown by the target of an invocation.
At line:1 char:1
+ Install-SPService
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...tInstallService:SPCmdletInstallService) [Install-SPService], TargetInvocationException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletInstallService

This is a very general error and in the logs I don't seem to recognize anything out of ordinary. Any help, please?

1
  • any pwoershell command completed successfully or every one is throwing the same error?
    – Waqas Sarwar MVP
    Commented Jan 11, 2018 at 14:32

1 Answer 1

2

ran into this issue before. Looks like you possibly do not have enough permission. It is clearly stated on msdn that you need to make sure that you have correctly setup the environment (not saying that you haven't) and that the account that you intend to use has adequate permission to run powershell code.

If you intend to use PowerShell commands to add the server, verify that you meet the following minimum memberships is installed.

Securityadmin fixed server role on the SQL Server instance.

db_owner fixed database role on all databases that are to be updated.

Administrators group on the server on which you are running the PowerShell cmdlets.

An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server 2016 cmdlets.

https://technet.microsoft.com/en-us/library/cc261752(v=office.16).aspx

make sure the account is in the SharePoint_Shell_Access role.

C:\PS>Add-SPShellAdmin -UserName CONTOSO\User1

https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/Add-SPShellAdmin?view=sharepoint-ps

also make sure that your using the same account that you originally used to create the farm which should have sufficient privileges.

EDIT

the fact that its failing at the start tells me that its a permission issue as your running the following code:

Install-SPService

that is installing and setting up/running services on the local machine. So it would need elevated rights. Saying that i am still confident your permission is still wrong. Try and open the ps console as administrator (right click -> run as administrator) or run the following code in the console Start-Process powershell -Verb runAs it should open up a console under admin elevated privileges then run your code Install-SPService

4
  • Thanks Ali for your help, but the account has full permissions. I have give both install and farm accounts local administrators rights. they have also the roles you mentioned above. This is actually happening on a second WFE which I just joined to the farm. Commented Jan 11, 2018 at 11:03
  • stupid question but are you running the powershell command under admin? try running this first PS> Start-Process powershell -Verb runAs and then run Install-SPService
    – Ali Jafer
    Commented Jan 11, 2018 at 11:42
  • Yes, it is running under admin privileges. I have even opened the powershell console under the following accounts install,farm,administrator, but did not help. Commented Jan 11, 2018 at 12:21
  • have you tried to run the rdp as local user not a service account. like the default admin account local to the server. That would do it but its not really recommended to use that account. You need to make sure that your domain accounts are in WSS_ADMIN_WPG membership technet.microsoft.com/en-us/library/mt842674(v=office.16).aspx to add it to group msdn.microsoft.com/en-us/library/hh567638(v=cs.95).aspx
    – Ali Jafer
    Commented Jan 11, 2018 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.