Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraction of SPFARM fails due to Cenadmin on HTTPS #88

Open
xenophobentx opened this issue Jun 16, 2019 · 1 comment
Open

Extraction of SPFARM fails due to Cenadmin on HTTPS #88

xenophobentx opened this issue Jun 16, 2019 · 1 comment

Comments

@xenophobentx
Copy link

[ SP2019APP1 ] Generating the SharePoint Prerequisites Installation...
[ SP2019APP1 ] Generating the SharePoint Binary Installation...
[ SP2019APP1 ] Scanning the SharePoint Farm...
Exception calling "PerformClick" with "0" argument(s): "An invalid value for CentralAdministrationPort is specified: 0"
At C:\Program Files\WindowsPowerShell\Scripts\SharePointDSC.Reverse.ps1:6256 char:13

  •         $btnExtract.PerformClick()
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : RuntimeException

My farm resource look like this:

SPFarm CreateSharePointFarm
{
IsSingleInstance = "Yes"
Ensure = 'Present'
FarmConfigDatabaseName = $configdata.farm.ConfigDB
DatabaseServer = $configdata.farm.ConfigDbServer
FarmAccount = $credsLocalAdmin
Passphrase = New-Object System.Management.Automation.PSCredential ('Passphrase', (ConvertTo-SecureString $Passphrase -AsPlainText -Force));
AdminContentDatabaseName = $configdata.farm.CentralAdminContentDB
RunCentralAdmin = $Node.roles.Contains("CA-PRIMARY")
CentralAdministrationPort = 22641
CentralAdministrationUrl = "https://sp2019app1.sky.net"
CentralAdministrationAuth = 'NTLM'
ServerRole = "CUSTOM"
PSDSCRunAsCredential = $credsLocalAdmin

            DependsOn                 = @('[WaitForAll]Waitforallbinaries', '[xPendingReboot]BeforeWizard')
        }

Same environment with http and same port work flawlessly. Tested multiple times on multiple servers. (Windows 2016 + SP2019 May CU)

@kayodebristol
Copy link

This seems to happen because $SPCentralAdmin.iisettings[0].ServerBindings.Port returns null on your farm... meaning you are only using https with 443 (SecureBindings.Port)

Find

$params.CentralAdministrationPort = $Script:spCentralAdmin.IisSettings[0].ServerBindings.Port

And change to

$params.CentralAdministrationPort = $Script:spCentralAdmin.IisSettings[0].ServerBindings.Port
    if($null -eq $params.CentralAdministrationPort -or $parms.CentralAdministrationPort -eq 0){
        $params.CentralAdministrationPort = $Script:spCentralAdmin.IisSettings[0].SecureBindings.Port
    }

In SharePointDSC.Reverse.ps1 script file.

I'll submit a pull request after more testing.

kayodebristol pushed a commit to kayodebristol/SharePointDSC.Reverse that referenced this issue Dec 9, 2019
kayodebristol pushed a commit to kayodebristol/SharePointDSC.Reverse that referenced this issue Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants