AutoSPInstaller icon indicating copy to clipboard operation
AutoSPInstaller copied to clipboard

Provisioning doesn't work when myhost on non-standard port

Open acou1304 opened this issue 4 years ago • 1 comments

I've seen this error reported a couple of years ago, where on line 3298 of AutoSPInstallerModule.psm1 it throws an exception because the $mySiteAppPool variable is not primed. Fundamentally, (apart from the missing variable) the script is looking to see if the MySite web application exists. The problem is that it doesn't append the ':' at the end if the port number is not 80 or 443. $getSPWebApplication = Get-SPWebApplication -Identity $mySiteURL -ErrorAction SilentlyContinue If ($null -eq $getSPWebApplication -and ($mySiteWebApp)) { Write-Host -ForegroundColor White " - Creating Web App "$mySiteName"..." New-SPWebApplication -Name $mySiteName -ApplicationPoolAccount $($mySiteAppPoolAcct.username) -ApplicationPool $mySiteAppPool -DatabaseServer $mySiteDBServer -DatabaseName $mySiteDB -Url $mySiteURL -Port $mySitePort -SecureSocketsLayer:$mySiteUseSSL @hostHeaderSwitch @pathSwitch @databaseCredentialsParameter | Out-Null }

Line 3294 will fail because the URL passed in is something like http://mysite instead of http://mysite:1280 (where the port number is 1280 for example).

acou1304 avatar Jul 19 '21 06:07 acou1304

This is an issue in June 2024 as well except that it fails on 3635. MySiteHost is set to 8081 in my setup script:

Creating Web App "MySite Host"... New-SPWebApplication : Cannot bind argument to parameter 'ApplicationPool' because it is null. At C:\Temp\AutoSPInstaller\SP\Automation\AutoSPInstallerModule.psm1:3635 char:132

  • ... ($mySiteAppPoolAcct.username) -ApplicationPool $mySiteAppPool -Databa ...

  •                                                ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [New-SPWebApplication], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.SharePoint.PowerShell.SPCmdletN ewSPWebApplication

    Right above the failing new-SPWebApplicatoin command I paste din this information $mySiteAppPool = "MySites"; $mySitePort = "8081";

VACoder avatar Jun 25 '24 21:06 VACoder