The Change Tracking tab is part of the ISA management console. But, it is implemented as an HTML files, and can operate outside the management console. To demonstrate this, I'll show how to use it as an enterprise Change Tracking viewer.
The HookIf you look in C:\Program Files\Microsoft ISA Server\UI_Htmls\ChangeTrackingTab.htm, you'll notice that it has a body_onload() function, and that this function calls ChangeTracking_onload() if it exists. Also notice that it includes a script tags that tries to load ChangeTrackingAdditions.js. So, all we need is to create our own ChangeTrackingAdditions.js with ChangeTracking_onload() in it, and it will be called!
The CodeSo, let's try it. Put the following into C:\Program Files\Microsoft ISA Server\UI_Htmls\ChangeTrackingAdditions.js:
function ChangeTracking_onload() { if (WithinSnapin()) { return; // Don't interfere with regular Management operation } var fpc = new ActiveXObject("FPC.Root"); // To connect to remote CSS, call fpc.ConnectToConfigurationStorageServer here var entLog = GetCTLog(fpc.Enterprise); var arrLogs = GetCTLogCollection(fpc.Arrays); var entPolLogs = GetCTLogCollection(fpc.Enterprise.Policies); insertTableHTML(arrLogs, entPolLogs, entLog); } function GetCTLogCollection(CTContainerCollection) { var logs=""; var oEnum = new Enumerator(CTContainerCollection); for( ; !oEnum.atEnd(); oEnum.moveNext() ) { logs = logs + GetCTLog(oEnum.item()); } return logs; } function GetCTLog(CTContainer) { try { var vendorSet = CTContainer.VendorParametersSets.Item("{1234C1BD-2502-4BDA-8EAD-B2DE4DD84A7D}"); return vendorSet.value("changes"); } catch (err) { return ""; // No CT log in this container } }
[TMG Update] In TMG, change function GetCTLog to:
function GetCTLog(CTContainer) { try { return CTContainer.ChangeTracking.ChangeLog; } catch (err) { return ""; // No CT log in this container } }
Now, launch ChangeTrackingTab.htm from Windows Explorer.
This concludes the Change Tracking series. I hope you enjoyed it. Happy ISAing!
-Jonathan Barner, ISA Sustained Engineering Team
Многие, посмотрев на заголовок поста воскликнут "Фу, какой баян" и будут абсолютно правы: это обновление...