strComputer = "." Set WshShell = WScript.CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Set wshnetwork = WScript.CreateObject("WScript.Network") Set Myfile= objfso.OpenTextFile("c:\ICA-CLIENT.log", 8, True) Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_TSGeneralSetting") strOCXLocation = WshShell.RegRead("HKCR\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\InprocServer32\") strICAVersion = objFSO.GetFileVersion(strOCXLocation) For Each objItem in colItems Myfile.Write "Computer : " & wshnetwork.ComputerName & " " & "ICA version : " & strICAVersion & " " _ & "RDP version : " & objItem.TerminalProtocol & VbCrLf Myfile.Close next