hi all,
is there anyway in SQL to getting logged in user name to windows on the pc that running the power bi report connected to SQL as i've tried some scripts but it retrieved the logged in user to the SQL server itself
I did search on some and found that script but it giving below error, is there any mistake I did?
DECLARE @CMD VARCHAR(500) =
(SELECT TOP 1 'tasklist /S ' + client_net_address +
' /FI "PID eq ' + CONVERT(VARCHAR(MAX),host_process_id) +
'" /V /FO LIST /U DOMAIN\Admin /P password'
FROM sys.dm_exec_connections C JOIN sys.dm_exec_sessions S
ON C.session_id = S.session_id WHERE S.session_id = @@SPID)
EXEC xp_cmdshell @CMD
Error:
output The system cannot find the file specified.
NULL