注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Tenhlf的博客

 
 
 

日志

 
 

ISA缓存清除工具  

2009-01-05 16:44:11|  分类: Microsoft |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Microsoft Internet Security and Acceleration Server 2004
Deleting Cache Contents

Microsoft® Internet Security and Acceleration (ISA) Server stores cached content in a cache content file, which is named Dir1.cdat and resides in the Urlcache folder on each drive that is configured for caching. A cache content file (.cdat file) is created when a drive is configured for caching. In addition, each time that the Microsoft Firewall service is started, it verifies that a cache content file is present on each drive that is configured for caching and automatically creates a new cache content file if the file has been deleted. The cached content stored in these files can be deleted manually by deleting all the cache content files and restarting the Firewall service. The Microsoft Visual Basic® Scripting Edition (VBScript) code in DeleteCacheContents.vbs (listed below) performs these steps programmatically and deletes all of the content stored in the ISA Server cache by replacing the cache content files stored on all the cache drives that are configured on the local ISA Server computer with new cache content files.

To delete cache contents
  1. Create an instance of the FPC COM object, which provides access to the other ISA Server administration COM objects.

  2. Declare an FPCServer object, an FPCCacheDrives collection, an FPCCacheDrive object, and a FileSystemObject object.

  3. Get references to the existing FPCServer object and FPCCacheDrives collection.

  4. Call the StopFirewallService method of the server object to stop the Microsoft Firewall service.

  5. Create an instance of the FileSystemObject object.

  6. In a For loop, iterate the drives in the cache drives collection. For each drive, compose the path to the file Dir1.cdat in the Urlcache folder on each drive and call the DeleteFile method of the file system object to delete the file.

  7. Call the StartFirewallService method of the server object to start the Firewall service and create a new cache content file on each cache drive.

ISA清楚缓存工具 - tenhlf - Tenhlf的博客 Script Listing: DeleteCacheContents.vbs

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' This script deletes all of the content stored in the ISA Server cache by

' deleting the cache content files stored on all the cache drives that are

' configured on the local ISA Server computer and then restarting the Firewall

' service, which creates new cache content files.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Sub DeleteCacheContents()

' Create the root obect.

Dim root ' The FPCLib.FPC root object

Set root = CreateObject("FPC.Root")

'Declare the other objects needed.

Dim server ' An FPCServer object

Dim cacheDrives ' An FPCCacheDrives collection

Dim cacheDrive ' An FPCCacheDrive object

Dim fso ' A file system object

Set server = root.GetContainingServer()

server.StopFirewallService()

Set cacheDrives = server.CacheDrives

Set fso = CreateObject("Scripting.FileSystemObject")

For Each cacheDrive In cacheDrives

cacheFilePath = CacheDrive.Name & "\urlcache\Dir1.cdat"

fso.DeleteFile cacheFilePath

Next

server.StartFirewallService()

WScript.Echo "All the cache content files have been replaced by new files!"

End Sub

DeleteCacheContents

 

 

For a tool that you can use to view real-time cache contents, save cache content to a file, and mark obsolete items that should not be served from the cache, see

 

http://technet.microsoft.com/zh-cn/library/cc302452(en-us).aspx

  评论这张
 
阅读(996)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018