I'm trying to run the automatic update script, but I keep getting a permission error with the database. Looking at the script it appears it's using the Enterprise Server web.config settings. My connection string in the web.config is the login for the SolidCP database. Does the update script require some special permissions? When I run the script an error message appears briefly on the screen before the main menu, but it's so quick I haven't been able to capture it.
I was able to capture the error message, but it doesn't make any sense. I logged into SSMS using the credentials in my web.config and was able to run the following query without error: SELECT [ServerUrl] FROM [SolidCP].[dbo].[Servers] WHERE [VirtualServer]='0'
Invoke-SQLCmd : The SELECT permission was denied on the object 'Servers', database 'SolidCP', schema 'dbo'. At C:\Users\admin\Desktop\SolidCP-Auto-Upgrade.ps1:298 char:45 + ... rverIPs = ((Invoke-SQLCmd -query "SELECT [ServerUrl] FROM [$SCP_Datab ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException + FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
I've noticed none of the Invoke-SQLCmd pass a username or password. Has anyone been able to get the automated update script to work? In the past I've always done my updates manually as I've never been able to get the update script to work, but someday I'd like to get the automated script to work.
Hello,
Currently the script does expect the person who is running it has permissions via Windows login to the SQL server. Is there a reason you login for a user without access?
Regards,
Trevor