Sempai.inFo - 411

411 info and facts.. also did you know?
Posted in Guides, Tutorials, Windows Server | |

So I ran into this issue the other day..

Scenario: My client has a Server 2003 PC and the C:\ was running low in diskspace started looking around to see what big files were on the system.. to my dismay I found c:\windows\system32\wbem\logs\Framework.log to be 600MB and growing slowly.. After some research on Google to check my theory that this file was way too big.. I found that this is a common issue in Server 2003 and has to do with a permissions issue on c:\windows\system32\wbem\logs folder.

Fix:
Set the permissions on the %systemroot%\system32\wbem\logs folder (example c:\windows\system32\wbem\logs ) so that the Network Service account has the Delete permission.

Locate the %systemroot%\system32\wbem\logs folder, right-click on the folder, and then select Properties.
On the Security tab, click the Advanced button.
Select the NETWORK SERVICE account from the Permission entries list, and then click Edit.
Locate the Delete permission, and then click to select the Allow checkbox.
Click OK three times.

delete the Framework.log file and you should be set

So I was working on a clients server today (Windows Server 2003 SBS) that was very low on diskspace on the C:\ .. 634MB actually..

Was sorting through all the folders to figure out where the space was.. To my supprise 4GB of disk usage was in C:\Documents and Settings\[USERNAME]\Local Settings\Temporary Internet Files\Content.IE5 which as anyone who works with computers knows is where friking IE caches websites and downloads. So the quick fix for this is to delete the contents of the folder.. but this is kinda a pain to manualy go into these folders and clear them out for 15 users and even harder if you do it the long way and login each one a click "Delete files" in IE for each account..

So I found this nice little script online someone made and though I would share it.. Credits to whoever wrote it.. Save the code in notepad as cleanup.vbs and then run it.

[Code]

On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."

Set objRegistry=GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys

For Each objSubkey In arrSubkeys
strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "\" & objSubkey
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE, strSubPath, strValueName, strValue
Dim Fol:Fol = strValue & "\Local Settings\Temporary Internet Files\Content.IE5"
If objFSO.FolderExists(Fol) Then
Set f = objFSO.GetFolder(Fol)
Set fc = f.SubFolders
For Each f1 in fc
f1.delete
Next
End If
Next

[/Code]



Your Ad Here