Home » SQL & PL/SQL » SQL & PL/SQL » how to retrive the user domain ?
how to retrive the user domain ? [message #184396] Wed, 26 July 2006 07:18 Go to next message
haitham
Messages: 60
Registered: February 2006
Member
am using windows os , i need to retrieve the user domain which he uses when logging into the windows NOT the domain of the machine...
the machine column of the v$session view retrives the domain of the machine not the domain which the user uses when he enters the windows...
plz reply,,
thanks.
icon6.gif  Re: how to retrive the user domain ? [message #185661 is a reply to message #184396] Wed, 02 August 2006 22:54 Go to previous messageGo to next message
aimy
Messages: 209
Registered: June 2006
Senior Member
Maybe you can use this script..

set linesize 125
set pagesize 109
column spid format a6
column sid format 999
column serial# format 99999
column machine format a25
column username format a14
column logon_time format a19
column type format a6
column program format a28
select p.spid, s.sid,s.serial#,s.machine,s.username,
to_char(s.logon_time, 'DD-MON-YY HH:MI:SS') logon_time, s.type, s.status, s.program
from v$process p, v$session s
where s.paddr=p.addr and s.type = 'USER' and s.username <> 'SYS' and s.username <> 'SYSTEM'
order by s.logon_time desc;


Under the 4th column, named MACHINE, the output would be something like this: DOMAIN\USERNAME
Re: how to retrive the user domain ? [message #185768 is a reply to message #185661] Thu, 03 August 2006 08:29 Go to previous message
haitham
Messages: 60
Registered: February 2006
Member

it gets the domain of the machine but i need the domain which the user uses when logging into the windows..
EXample : when RIght click on my computer ,properties,computer name , domain : stuff
but the user may log into the window using the domain students

that query retrieves the domain as staff
but i need it to retrieve the domain as students .
thanks..
Previous Topic: calculate the time difference
Next Topic: SQL query required (Merged)
Goto Forum:
  


Current Time: Fri Dec 09 02:10:23 CST 2016

Total time taken to generate the page: 0.06466 seconds