Friday, November 14, 2008

[THIN] Re: One for the script kiddies....

He's some VBS to help you with get the output from a command line to a variable in VBS

----------------------------------
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")

'The tool is launched
Set oExec = WshShell.Exec("getpubapp.exe")

'We wait for the end of process
Do While oExec.Status = 0
WScript.Sleep 100
Loop

'initialize the variable that the output will go to
MyVar=""

'We scan and append the command output flow to MyVar
Do While oExec.StdOut.AtEndOfStream <> True

MyVar = MyVar + oExec.StdOut.ReadLine
Loop

'MyVar is now ready to be used with the command line output assigned
'In this example we'll just write it to the screen with some asterix
'either side

Wscript.Echo "****"+MyVar+"****"

----------------------------------
--
Warren Simondson

Ctrl-Alt-Del IT Consultancy Pty Ltd
Website: http://www.ctrl-alt-del.com.au


Quoting IT Support <it@polyco.co.uk>:

> Thanks Joe & Warren.
>
> I used getpubapp and reconnact! to get the info I need into my log.
>
> This a bit off topic but hopefully someone will know this straight
> away -
>
> I piped the output of getpubapp to a random temporary file, read it
> back in to a variable to append to my csv, and then deleted the temp
> file.
>
> All this is very long winded and adds precious milliseconds to the
> login process...
>
> Does anyone know of a better way to implement this? i.e - read
> directly from the console output into a variable?
>
> Thanks in advance!
>
> N.
>
>
>
>
>
> From: thin-bounce@freelists.org [mailto:thin-bounce@freelists.org] On
> Behalf Of Joe Shonk
> Sent: 13 November 2008 17:50
> To: thin@freelists.org
> Subject: [THIN] Re: One for the script kiddies....
>
> Login Consultants has a free utility called ReconnAct! That does
> exactly what you're asking for. (not sure about the published app,
> but the client IP and the ability to run a script when a user
> disconnects and/or reconnects.)
>
> Joe
>
> From: thin-bounce@freelists.org [mailto:thin-bounce@freelists.org] On
> Behalf Of IT Support
> Sent: Thursday, November 13, 2008 9:45 AM
> To: 'thin@freelists.org'
> Subject: [THIN] One for the script kiddies....
>
> Hi All,
>
> I'm working on creating a central csv log of all logon / logoff
> requests to our citrix farms.
>
> So far I have cribbed together a vbs running via logon / logoff
> scripts to collect various data from environmental variables and
> append to a daily csv file.
>
> It's working OK, but I'd like to extend to include the name of the
> current published application & client ip address, but I can't figure
> out how to get this.
>
> Also, does anyone know of a way to trigger a script when a session
> disconnects or reconnects?
>
> T-I-A
>
>
>
>
> BM Polyco Ltd Disclaimer
> This e-mail and the information it contains are confidential. If you
> have received this message in error please notify us immediately. You
> should not use or copy it for any purpose nor disclose its contents
> to any other party. The contents of this communication are advisory
> and are not binding on the Company unless supported by authorised
> documentation.
> It has also passed through the MailControl Anti-Virus service powered
> by BlackSpider for total peace of mind.
>
>
> Click
> here<https://www.mailcontrol.com/sr/mIq9Qj04FkfTndxI!
oX7Uj5Un8Ja1WtLtZOOSnJRCXRwno9aBs6a3En3hfRYbCRXURwikaZmT9jwq3xXRfv08Q==>
> to report this email as spam.
>

************************************************
For Archives, RSS, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link:
http://www.freelists.org/list/thin
NEW! Follow Thin List on Twitter!
http://twitter.com/thinlist
Thin List discussion is now available in blog format at:
http://thinmaillist.blogspot.com
HOT! Thinlist MOBILE Feed!
http://thinlist.net/mobile
Thinlist quick pick
http://thinlist.net
************************************************

No comments: