Skip to content

Instantly share code, notes, and snippets.

@nanoDBA
Created December 11, 2020 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanoDBA/c5b7bf8ed812abda5e22d613013e9f5d to your computer and use it in GitHub Desktop.
Save nanoDBA/c5b7bf8ed812abda5e22d613013e9f5d to your computer and use it in GitHub Desktop.
Impersonating an Application Name Using Connect-DbaInstance
$cred = Get-Credential 'domain\someAccount'
$connFakeClient = Connect-DbaInstance -SqlInstance YOURSQLSRVR -SqlCredential $cred -ClientName "Test App"
Invoke-DbaQuery -SqlInstance $connFakeClient -Query "WAITFOR DELAY '00:02:00'" -MessagesToOutput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment