Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Citrix Logging Script

Status
Not open for further replies.

netwalker1

Programmer
Feb 5, 2000
1,241
EG
As Citrix is the Application Server System , And as it acts as the gateway for the outside users to gain access to Internal Services , We always searched for how to secure it , and how to monitor its services…

Here is a very good way to monitor the users who login to the Citrix System , and to log the Application they used :

1-Create a file with the name : NfuseLogging.vbs using a notepad , and in use these commands inside this script :[red]

<%
Function NfuseLogging_AddEvent(EventText)
' * Constants ****
Dim GMTOffset, LogPath, LogFilename, FSO, TSO, EpochNumber

GMTOffset = 7200 ' number of seconds after GMT in my timezone ( + 2 hours )

LogPath = "\\office-dc\citrix_log\" ' The place of the log file which will be created

LogFilename = "time.txt" ' the Log File name

' * Initialise Log ****
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(LogPath & LogFilename) Then
Set TSO = FSO.OpenTextFile(LogPath & LogFilename, 8, True)
Else
Set TSO = FSO.CreateTextFile(LogPath & LogFilename, True)
End If

' * Append Log Entry ****
TSO.writeline date & "," & time & "," & EventText

' * Clean up ****
TSO.close
Set TSO = Nothing
Set FSO = Nothing
End Function
%>[/red]

2-Copy the Last File to this Path :
\Inetpub\
3-Edit The launchImpl.vbs script which will be found in the same path , and Make the begging of the script looks like this :[red]

<%
' launchImpl.vbs
' Copyright (c) 2000 - 2003 Citrix Systems, Inc. All Rights Reserved.
' NFuse 2.0 (Build 33508#14449)
%>[/red][green]
'***********************
' Start Of The Modification *
'***********************

<!--#include file="NfuseLogging.vbs"-->

'**********************
' End Of The Modification *
'**********************[/green]

And In the Last of the Script add :

[red]If Not launch(nfuseAppName, nfuseFriendlyName, cmdLine, logonMode) Then
Response.ContentType = "text/html; charset=UTF-8"
Response.write "<script language='JavaScript'>" & vbCrLf
Response.write "<!--" & vbCrLf

Response.write "parent.frames[0].location.href = 'applist.asp" & getErrorQueryStr(MSG_ERROR, message) & "&NFuse_currentFolder=" & gApp.urlEncode(currentFolder) & "'" & ";" & vbCrLf

Response.write "//-->" & vbCrLf
Response.write "</script>" & vbCrLf

End If[/red][green]
'*******************
' Modification *
'*******************
NfuseLogging_AddEvent(user & "," & nfuseFriendlyName)
'********************
' End Of Modification *
'********************[/green][red]
%>[/red]



Mohamed Farid
Know Me No Pain , No Me Know Pain !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top