Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-DbaQuery, re-wire connection with integrated as another user #9592

Open
wants to merge 8 commits into
base: development
Choose a base branch
from

Conversation

niphlod
Copy link
Contributor

@niphlod niphlod commented Feb 20, 2025

Type of Change

Purpose

Tried to put it all in the new comments. Feel free to ping me on Slack for further details.
I'd like someone to try it in their own environment and see if it breaks things.

Small test

$cred = Get-Credential 'domain\anotheruser'
$server = Connect-DbaInstance -SqlInstance 'yourinstance' -Database dbatools -SqlCredential $cred
Invoke-DbaQuery -SqlInstance $server -Query 'select suser_sname()'
$server.Query('select suser_sname()')

Approach

Path of least resistance, should kick in and recreate the connection only if needed, if not, back to pooling that helps with performances.

@niphlod niphlod mentioned this pull request Feb 20, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant