VERIFIED SOLUTION i

Portrait Shared Server 2.1 installation error Failed to connect

AFFECTED VERSIONS
Portrait Shared Server (PSS) 2.1 install/upgrade script 
Included with Portrait Dialogue (PD) 6.1 and 
​Portrait Interaction Optimizer (IO) version 5.6
Portrait Explorer (PE) version  5.0

 

Issue

Portrait Shared Server (PSS) 2.1 install/upgrade script 
Included with Portrait Dialogue (PD) 6.1 and
Portrait Interaction Optimizer (IO) version 5.6
Portrait Explorer (PE) version  5.0

When creating or updating the Portrait Shared Server databases using the CreatePortraitDatabases.ps1 PowerShell script, the script fails with the message “The following exception occurred while trying to enumerate the collection: Failed to connect to server [ServerName]”.
 

Cause

When running the CreatePortraitDatabases.ps installation script, the CheckValidDBUser PowerShell function runs as the current windows user.
The SQL Server needs to allow the current windows user to connect for the function to run successfully.
 

Resolution

UPDATED: April 12, 2017
In SQL Server, add the current windows user as a Login that uses Windows Authentication.
The minimum permission required is the ‘public’ server role. 
If your SQL Server doesn’t support Windows Authentication, contact Portrait Support for details on how to avoid calling CheckValidDBUser.