Webprevent_script.vbs_.txt Dim StdOut : Set StdOut = Wscript.Stdout Dim objArgs : Set objArgs = WScript.Arguments e=0 numArgs = objArgs.Count dim attributeList dim attributes '09/01/2013 - defines the attributes from the Lookup Plugin framework that we are going to use in this script. ' The numbers above that are commented out are for reference as they are used differently within the script. ' Only really using sender-email, protocol, and date-detected, but no harm leaving those others in there in ' case we need them down the line for other things. ' 0 1 2 3 4 attributeList = ("sender-email,protocol,sender-ip,endpoint-user-name,date-detected") attributes = split(attributeList,",") Dim attributeValues(4) '09/01/2013 - this LOOP structure parses out the attribute name and attribute value from each argument passed ' by the Plugin framework. Basically takes everything to the left of the "=" sign as the argument name, and ' everything to the right of it as the argument value. Do Until e = numArgs strEqPos = Instr(objArgs(e),"=") strArgName = mid(objArgs(e),1,strEqPos - 1) strValLen = len(objArgs(e)) - strEqPos strArgVal = mid(objArgs(e), strEqPos + 1, strValLen ) x=o '09/01/2013 - this part assigns the attribute value for [x] attribute based on the attributes defined in the ' attributeList array. for each attribute in attributes if strArgName = attribute then attributeValues(x)=strArgVal end if x=x+1 next e = e+ 1 Loop '09/01/2013 - This part is used to parse out the user name from web incidents, which are passed by the proxy ' with the domain/username convention. For the LDAP lookup, we look up against the sAMAccountName field, which ' does not include domain, which is why we need to strip it out. If attributeValues(1) = "HTTP" OR attributeValues(1) = "FTP" Then strSlashPos = Instr(9,attributeValues(0), "/") strUserName = mid(attributeValues(0), strSlashPos + 1) stdOut.WriteLine "HTTPUserName="&strUserName End If