We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mumbles76
Posts: 29
Joined: Mon Nov 16, 2015 7:29 pm

SQL Windows Authentication as different user.

Hello All,

We have a unique requirement. We are running Advanced Installer 12.6 and we need to run some SQL Server scripts as a windows authentication user.

However, that user isn't the user installing the application. And running as SQL Authentication isn't an option.

Is there a way to do this? Emailed support also.

Please advise, thank you so much!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: SQL Windows Authentication as different user.

Hello,

I'm afraid this scenario is not supported.

Not even with SQL Manangement Studio you cannot login with another windows authentication user than the logon user. You can either select SQL Authentication (provide user and password) or Windows Authentication (logon user).

Please let me know if there is anything else I can help you with.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mumbles76
Posts: 29
Joined: Mon Nov 16, 2015 7:29 pm

Re: SQL Windows Authentication as different user.

Just in case anyone comes across this thread at a later time and has a similar requirement...

We are in an environment where the installing user isn't a SQL SysAdmin, but that user has the credentials for another user that is a SysAdmin. And only Windows Authentication is allowed.

1. We created a dialog which collects the SysAdmin username and password.
2. We created a custom action which temporarily gives SysAdmin role to the installing user via a custom action that calls a batch script (as seen below.)
3. Let the installer run though all of it's SQL scripts and actions.
4. Set the installing user back to a non-SysAdmin using the uninstall parameter.

Batch Script:

SET Mode=%1
SET LoggedInUser=%2
SET SQLSysadmin=%3
SET DatabaseServer=%4

IF "%Mode%"=="Install" (
runas.exe /user:%SQLSysadmin% "sqlcmd -S %DatabaseServer% -E -Q \"EXEC master..sp_addsrvrolemember @loginame = N'%LoggedInUser%', @rolename = N'sysadmin'\""
)
IF "%Mode%"=="UnInstall" (
runas.exe /user:%SQLSysadmin% "sqlcmd -S %DatabaseServer% -E -Q \"EXEC master..sp_dropsrvrolemember @loginame = N'%LoggedInUser%', @rolename = N'sysadmin'\""
)

Hope that helps someone somewhere on secure STIG'd environments.

Return to “Building Installers”