We have used the following Batch script to find where a user is logged in at...

However, it does appear to have limitations. You have to hit the server where the user logs in at to get results. You cannot run this from a workstation.

Pinging Alex.. Pinging Shawn.. It should be doable in ADSI, but we are running in mixed-mode until all of our servers/systems are converted over to 2000.

I have created in our Kix script the ability to log the users, but the log gets pretty unwieldy and you have to search in reverse order.

I did find the following.. http://cwashington.netreach.net/depo/view.asp?Index=198&ScriptType=vbscript


DISCLAIMER - This batch script has been around a while, it is not my original work.

code:

@echo off
setlocal
if NOT "%1"=="" goto begin
:syntax
@echo Syntax: WhereUAt UserName1 [UserName2 ... UserNameN]
endlocal
goto end
:begin
if "%1"=="" endlocal & goto end
set user=%1
set user=%user:"=%
shift
for /f "Skip=4 Tokens=*" %%i in ('net session') do call arse "%%i"
goto begin
arse
set str=%1
set str=%str:"=%
if "%str%"=="The command completed successfully." goto end
for /f "Tokens=*" %%i in ('@echo %%str:~23^,20%%') do set substr=%%i?
if "%substr%"=="ECHO is on.?" goto end
set substr=%substr: =%
set substr=%substr: ?=%
set substr=%substr:?=%
if /i not "%user%"=="%substr%" goto end
@echo %str%
:end

I was able to munge some this together from some code from http://cwashington.netreach.net

code:

$DCString = "DOMAIN"
$User = "kdyer"
$DomainObj = GetObject("WinNT://" + $DCString)
$DomainObj.filter = array($User)

For Each $UserObj In $DomainObj
$Name = $UserObj.Name
$Description = $UserObj.Description
$FullName = $UserObj.FullName
$LastLogin = $UserObj.LastLogin
$AuthServer = $DCString
next


It would be pretty cool to not only have the workstation ID(s) where the user has logged in at, but time(s) they logged in too.

Thanks for any insight.

- Kent

[ 07 February 2002: Message edited by: kdyer ]

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's