From: mcmallar on

Hi all.

I would need a script (vbscript - I can script this a bit, or perl)
which I give username and returns me computer name, where user is
logged on. I assume this information must be hidden somewhere.

We are using Active Directory on Windows Server 2003 platform.

BTW: Does anyone know, how can I give external parameters to vbscript
like -script.vbs para1 para2....-

Thanks, Peter



--
mcmallar
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

From: Jerold Schulman on
On Tue, 22 Nov 2005 03:22:44 -0600, mcmallar <mcmallar.1yw79o(a)mail.codecomments.com> wrote:

>
>Hi all.
>
>I would need a script (vbscript - I can script this a bit, or perl)
>which I give username and returns me computer name, where user is
>logged on. I assume this information must be hidden somewhere.
>
>We are using Active Directory on Windows Server 2003 platform.
>
>BTW: Does anyone know, how can I give external parameters to vbscript
>like -script.vbs para1 para2....-
>
>Thanks, Peter


See tip 4712 ? PsLoggedOn freeware tells you who is logged onto a computer, or it can locate a user.
in the 'Tips & Tricks' at http://www.jsifaq.com

psLoggedOn -L %UserName%
........................
Dim objArg
Set objArg = Wscript.Arguments
if objArg.Count < 2 then
Wscript.Echo "Two arguments are required"
WScript.Quit (1)
End If
Arg1=objArg(0)
Arg2=objArg(1)

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
From: maximillianx on
Doesn't that tool query every computer that is in the AD structure? If I'm
not mistaken, it takes a LOOONG time to do this.

Rob


"Jerold Schulman" <Jerry(a)jsiinc.com> wrote in message
news:gq46o1tt0jochhprmgea1ls8pqc9cc3m39(a)4ax.com...
> On Tue, 22 Nov 2005 03:22:44 -0600, mcmallar
> <mcmallar.1yw79o(a)mail.codecomments.com> wrote:
>
>>
>>Hi all.
>>
>>I would need a script (vbscript - I can script this a bit, or perl)
>>which I give username and returns me computer name, where user is
>>logged on. I assume this information must be hidden somewhere.
>>
>>We are using Active Directory on Windows Server 2003 platform.
>>
>>BTW: Does anyone know, how can I give external parameters to vbscript
>>like -script.vbs para1 para2....-
>>
>>Thanks, Peter
>
>
> See tip 4712 ? PsLoggedOn freeware tells you who is logged onto a
> computer, or it can locate a user.
> in the 'Tips & Tricks' at http://www.jsifaq.com
>
> psLoggedOn -L %UserName%
> .......................
> Dim objArg
> Set objArg = Wscript.Arguments
> if objArg.Count < 2 then
> Wscript.Echo "Two arguments are required"
> WScript.Quit (1)
> End If
> Arg1=objArg(0)
> Arg2=objArg(1)
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com
> http://www.jsifaq.com


From: ESP on
Yes, you are correct. It hits every machine in the network.
To extend to this question, has anyone successfully query the WINS database
for this info ??

ESP




"maximillianx" wrote:

> Doesn't that tool query every computer that is in the AD structure? If I'm
> not mistaken, it takes a LOOONG time to do this.
>
> Rob
>
>
> "Jerold Schulman" <Jerry(a)jsiinc.com> wrote in message
> news:gq46o1tt0jochhprmgea1ls8pqc9cc3m39(a)4ax.com...
> > On Tue, 22 Nov 2005 03:22:44 -0600, mcmallar
> > <mcmallar.1yw79o(a)mail.codecomments.com> wrote:
> >
> >>
> >>Hi all.
> >>
> >>I would need a script (vbscript - I can script this a bit, or perl)
> >>which I give username and returns me computer name, where user is
> >>logged on. I assume this information must be hidden somewhere.
> >>
> >>We are using Active Directory on Windows Server 2003 platform.
> >>
> >>BTW: Does anyone know, how can I give external parameters to vbscript
> >>like -script.vbs para1 para2....-
> >>
> >>Thanks, Peter
> >
> >
> > See tip 4712 ยป PsLoggedOn freeware tells you who is logged onto a
> > computer, or it can locate a user.
> > in the 'Tips & Tricks' at http://www.jsifaq.com
> >
> > psLoggedOn -L %UserName%
> > .......................
> > Dim objArg
> > Set objArg = Wscript.Arguments
> > if objArg.Count < 2 then
> > Wscript.Echo "Two arguments are required"
> > WScript.Quit (1)
> > End If
> > Arg1=objArg(0)
> > Arg2=objArg(1)
> >
> > Jerold Schulman
> > Windows Server MVP
> > JSI, Inc.
> > http://www.jsiinc.com
> > http://www.jsifaq.com
>
>
>
From: Fosco on
"mcmallar"

I don't use this script myself .. try

'**************************************************************************
' Questo Script genera un file di testo incrementale che visualizza
' le Info logon di rete di un utente
'
' File: Userinfo.vbs
'
' Autore: Claudio Ionfrida
'
'**************************************************************************

Set WshNetwork = WScript.CreateObject("WScript.Network")
DIM fso, NewsFile
DIM user
DIM pc
dim f
dim path

path = "\\nomerserver\share\userinfo.txt"
user = WshNetWork.Username
pc = WshNetwork.Computername

Set fso = CreateObject("Scripting.FileSystemObject")
if (fso.FileExists(path)) Then

'Se il File userinfo.txt esiste si incrementa.

Set f = fso.OpenTextFile(path, 8, True)
f.Write "L'utente "&user&" si ? collegato al computer "&pc&" in data "&now() &VbCrLf
f.Close


else

'Se il File userinfo.txt non esiste viene creato.

Set NewsFile = fso.CreateTextFile(path)
NewsFile.WriteLine("L'utente "&user&" si ? collegato al computer "&pc&" in data "&now())
NewsFile.Close
end if


--
Fosco