Script version DL'd on 9/23/2013.
Appears to be creating a SQL client alias regardless of whether I check the "Enable" box or not.
Verified that "Enable" box was unchecked.
Verified that XML value was "false".
Verified that no value exists for Instance or port in XML.
Run script and it tries to create an alias anyway.
Looked in functions PS1 and found this code:
```
# ====================================================================================
# Func: CheckSQLAccess
# Desc: Checks if the install account has the correct SQL database access and permissions
# By: Sameer Dhoot (http://sharemypoint.in/about/sameerdhoot/)
# From: http://sharemypoint.in/2011/04/18/powershell-script-to-check-sql-server-connectivity-version-custering-status-user-permissions/
# Adapted for use in AutoSPInstaller by @brianlala
# ====================================================================================
Function CheckSQLAccess
{
WriteLine
# Look for references to DB Servers, Aliases, etc. in the XML
ForEach ($node in $xmlinput.SelectNodes("//*[DBServer]|//*[@DatabaseServer]|//*[@FailoverDatabaseServer]"))
{
$dbServer = (GetFromNode $node "DBServer")
If ($node.DatabaseServer) {$dbServer = GetFromNode $node "DatabaseServer"}
# If the DBServer has been specified, and we've asked to set up an alias, create one
If (!([string]::IsNullOrEmpty($dbServer)) -and ($node.DBAlias.Create -eq $true))
{
$dbInstance = GetFromNode $node.DBAlias "DBInstance"
$dbPort = GetFromNode $node.DBAlias "DBPort"
# If no DBInstance has been specified, but Create="$true", set the Alias to the server value
If (($dbInstance -eq $null) -and ($dbInstance -ne "")) {$dbInstance = $dbServer}
If (($dbPort -ne $null) -and ($dbPort -ne ""))
{
Write-Host -ForegroundColor White " - Creating SQL alias `"$dbServer,$dbPort`"..."
#Add-SQLAlias -AliasName $dbServer -SQLInstance $dbInstance -Port $dbPort
}
Else # Create the alias without specifying the port (use default)
{
Write-Host -ForegroundColor White " - Creating SQL alias `"$dbServer`"..."
#Add-SQLAlias -AliasName $dbServer -SQLInstance $dbInstance
}
}
$dbServers += @($dbServer)
}
```
You can see where I commented out the "Add-SQLAlias" function call.
It appears from my debugging that the first call triggers regardless of the xml settings (i.e. no check box for "create alias". I commented out both mostly out of rage, but commenting out the first one actually did the trick for me.
The reason I needed to bypass creation of an alias at all is because the Alias that it DOES create was of a format I never saw before and the script could not use once it did. I opted to create manually and skip this portion of the script instead. Once it passed this portion it ran up to the point of installing binaries.
If interested in the Alias protocol / format issue, I submitted my experience with it in a separate issue.
Thanks!
Comments: ** Comment from web user: brianlala **
Appears to be creating a SQL client alias regardless of whether I check the "Enable" box or not.
Verified that "Enable" box was unchecked.
Verified that XML value was "false".
Verified that no value exists for Instance or port in XML.
Run script and it tries to create an alias anyway.
Looked in functions PS1 and found this code:
```
# ====================================================================================
# Func: CheckSQLAccess
# Desc: Checks if the install account has the correct SQL database access and permissions
# By: Sameer Dhoot (http://sharemypoint.in/about/sameerdhoot/)
# From: http://sharemypoint.in/2011/04/18/powershell-script-to-check-sql-server-connectivity-version-custering-status-user-permissions/
# Adapted for use in AutoSPInstaller by @brianlala
# ====================================================================================
Function CheckSQLAccess
{
WriteLine
# Look for references to DB Servers, Aliases, etc. in the XML
ForEach ($node in $xmlinput.SelectNodes("//*[DBServer]|//*[@DatabaseServer]|//*[@FailoverDatabaseServer]"))
{
$dbServer = (GetFromNode $node "DBServer")
If ($node.DatabaseServer) {$dbServer = GetFromNode $node "DatabaseServer"}
# If the DBServer has been specified, and we've asked to set up an alias, create one
If (!([string]::IsNullOrEmpty($dbServer)) -and ($node.DBAlias.Create -eq $true))
{
$dbInstance = GetFromNode $node.DBAlias "DBInstance"
$dbPort = GetFromNode $node.DBAlias "DBPort"
# If no DBInstance has been specified, but Create="$true", set the Alias to the server value
If (($dbInstance -eq $null) -and ($dbInstance -ne "")) {$dbInstance = $dbServer}
If (($dbPort -ne $null) -and ($dbPort -ne ""))
{
Write-Host -ForegroundColor White " - Creating SQL alias `"$dbServer,$dbPort`"..."
#Add-SQLAlias -AliasName $dbServer -SQLInstance $dbInstance -Port $dbPort
}
Else # Create the alias without specifying the port (use default)
{
Write-Host -ForegroundColor White " - Creating SQL alias `"$dbServer`"..."
#Add-SQLAlias -AliasName $dbServer -SQLInstance $dbInstance
}
}
$dbServers += @($dbServer)
}
```
You can see where I commented out the "Add-SQLAlias" function call.
It appears from my debugging that the first call triggers regardless of the xml settings (i.e. no check box for "create alias". I commented out both mostly out of rage, but commenting out the first one actually did the trick for me.
The reason I needed to bypass creation of an alias at all is because the Alias that it DOES create was of a format I never saw before and the script could not use once it did. I opted to create manually and skip this portion of the script instead. Once it passed this portion it ran up to the point of installing binaries.
If interested in the Alias protocol / format issue, I submitted my experience with it in a separate issue.
Thanks!
Comments: ** Comment from web user: brianlala **
As I mentioned in your other issue, I can't be sure that the GUI is properly setting the required value in the XML for "false" - therefore please try manually editing the XML as a workaround, and let me know if the issue still occurs.
Brian