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

Get-DbaProcess - Add information about endpoint and DAC #9304

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions public/Get-DbaProcess.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ function Get-DbaProcess {
c.encrypt_option AS EncryptOption,
c.auth_scheme AS AuthScheme,
c.net_packet_size AS NetPacketSize,
c.client_net_address AS ClientNetAddress
c.client_net_address AS ClientNetAddress,
e.name AS EndpointName,
e.is_admin_endpoint AS IsDac
FROM sys.dm_exec_connections c
JOIN sys.dm_exec_sessions s
on c.session_id = s.session_id
JOIN sys.endpoints e
ON c.endpoint_id = e.endpoint_id
CROSS APPLY sys.dm_exec_sql_text(c.most_recent_sql_handle) t"

if ($server.VersionMajor -gt 8) {
Expand Down Expand Up @@ -195,8 +199,10 @@ function Get-DbaProcess {
Add-Member -Force -InputObject $session -MemberType NoteProperty -Name NetPacketSize -value $row.NetPacketSize
Add-Member -Force -InputObject $session -MemberType NoteProperty -Name ClientNetAddress -value $row.ClientNetAddress
Add-Member -Force -InputObject $session -MemberType NoteProperty -Name LastQuery -value $row.Query
Add-Member -Force -InputObject $session -MemberType NoteProperty -Name EndpointName -value $row.EndpointName
Add-Member -Force -InputObject $session -MemberType NoteProperty -Name IsDac -value $row.IsDac

Select-DefaultView -InputObject $session -Property ComputerName, InstanceName, SqlInstance, Spid, Login, LoginTime, Host, Database, BlockingSpid, Program, Status, Command, Cpu, MemUsage, LastRequestStartTime, LastRequestEndTime, MinutesAsleep, ClientNetAddress, NetTransport, EncryptOption, AuthScheme, NetPacketSize, ClientVersion, HostProcessId, IsSystem, LastQuery
Select-DefaultView -InputObject $session -Property ComputerName, InstanceName, SqlInstance, Spid, Login, LoginTime, Host, Database, BlockingSpid, Program, Status, Command, Cpu, MemUsage, LastRequestStartTime, LastRequestEndTime, MinutesAsleep, ClientNetAddress, NetTransport, EncryptOption, AuthScheme, NetPacketSize, ClientVersion, HostProcessId, IsSystem, EndpointName, IsDac, LastQuery
}
}
}
Expand Down
Loading