brianlala / AutoSPInstaller

Automated SharePoint 2010/2013/2016/2019/SE PowerShell-based installation script.
https://autospinstaller.com
MIT License
171 stars 81 forks source link

AutoSPInstallerModule.psm1 Fails to make SQL alias correctly if WFE name is similar to SQL host name. #77

Open SPDEVGUY opened 3 years ago

SPDEVGUY commented 3 years ago

Unusual environment has discovered an edge case!

The WFE host is "NMS-SPUAT" the SQL Host is "NMS-SPUATSQL".

in AutoSPInstallerModule.psm1 Function Add-SQLAlias () line 7256:


If ((MatchComputerName $SQLInstance $env:COMPUTERNAME) -or ($SQLInstance.StartsWith($env:ComputerName +"\"))) {
        $protocol = "dbmslpcn" # Shared Memory
        }
    else {
        $protocol = "DBMSSOCN" # TCP/IP
    }

Match computer name is returning a false positive as this is supposed to be checking if the SQL host is the same machine as the sharepoint host and using named pipes instead of TCP/IP.

The cliconfig entry also gets really odd... image

SPDEVGUY commented 3 years ago

Changing it to:

If (($SQLInstance -eq $env:COMPUTERNAME) -or ($SQLInstance.StartsWith($env:ComputerName +"\"))) {

May fix it, I'll leave it to your team to fix it the best way possible