Monday 5 July 2010

Script ile ISA Server Cache'ini temizlemek

ISA Server'da Cache dosyasini temizlemek icin asagidaki basit script ten yararlanabilirsiniz, aslinda manual olarak yaptigimiz Firewall servisinin durdurulmasi , ardindan Cache dosyasinin silinmesi ve servisin yeniden baslatilmasindan farkli bir islem yapmamakta, ancak otomatize etmek icin duz bir batch dosyasindan daha faydali olacaktir surucu ismi statik olmadigi icin ve birden fazla dosyaniz var ise bulup temizleyebilecegi icin.

Unutmayinizki Firewall servisi bu islem sirasinda durdurulup yeniden baslatilacagi icin baglantilarinizda kesinti olacaktir.


Set root = CreateObject("FPC.Root")
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"
WScript.echo "Cache dosyasinin yeri: " & cacheFilePath
fso.DeleteFile cacheFilePath
Next
server.StartFirewallService()
WScript.Echo "Cache icerigi temizlenmistir"

No comments:

Post a Comment