Share via

Error runing - SPPatchify.PS1 Version : 0.150

VYAS Anitha (Con) 31 Reputation points
2020-11-02T07:51:26.37+00:00

Hi Forum,

Running sppatchify Version : 0.150, give below error message. But when you run Version : 0.129 , the patch script runs with out any error.
https://www.spjeff.com/2016/05/16/sppatchify-cu-patch-entire-farm-from-one-script/

Could anyone let us know why is that?


SPPatchify version 0.150 last modified 01-03-2020
Content Databases Online: 15
===== Read IIS PW ===== 11/02/2020 13:51:57
Logged in as ******
Enter password :

Test Remote PowerShell
Succeess
Invoke-Command : Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument
that is not null or empty, and then try the command again.
At D:\Releases\October2020.CU\SPPatchify.ps1:1489 char:39

  • $result = Invoke-Command -Session (Get-PSSession) -ScriptBlock $sb
  • ~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
  • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand

Thanks,

Microsoft 365 and Office | SharePoint Server | For business

2 answers

Sort by: Most helpful
  1. VYAS Anitha (Con) 31 Reputation points
    2020-11-04T04:54:51.937+00:00

    Hi Elisie,

    Powershell is allowed to remote access all the servers of the farm.

    I run these command on all servers before running the scripts.

    Register-PSSessionConfiguration -Name DelegatedSPAdmin -AccessMode Remote -Force -ShowSecurityDescriptorUI
    Enable-PSRemoting -Force
    Enable-WSManCredSSP -Role Server –Force
    Enable-WSManCredSSP -role Client -DelegateComputer *
    Restart-Service WinRM

    Set-ExecutionPolicy –ExecutionPolicy Unrestricted

    i do think the issue with the Version : 0.150 of the script.

    Thanks,

    Was this answer helpful?


  2. Elsie Lu_MSFT 9,806 Reputation points
    2020-11-03T08:27:24.09+00:00

    Hi @VYAS Anitha (Con) ,

    Have you allowed PowerShell remoting on all farm servers according to the reference before running the script? Also please have a check whether you are running CMD with administrator rights. If it is related to the version of the script, I would suggest contacting the author for more help.
    36909-1131.jpg

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

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