IIS and SBS Logs

(This is expanding on the existing post “Reclaiming Disk Space Lost to IIS Logs on SBS 2003 and SBS 2008”)

By default, all IIS hosted web sites have logging enabled, this can lead to some large folders in C:\inetpub\logs\LogFiles (Review this post in case you have moved your log files)You may also want to specifically stop logging all together for certain web sites, in particular, the “WSUS Administration” web site (Site Id 1372222313). For this, perform the following steps:

  1. Launch IIS Manager from Administrative Tools.
  2. Expand Server, Sites, and select the WSUS Administration web site.
  3. On the feature panel, click to open Logging.
  4. Click Disable in the Actions panel (rightmost panel)
  5. Repeat the steps for any other web site. Please note that logging may be needed for troubleshooting or auditing purposes on sites that are public facing, this is usually not the case on the WSUS Administration site.

Some of the SBS 2008 log files can grow to very large sizes, all SBS logs are stores in this folder (and subfolders): C:\Program Files\Windows Small Business Server\Logs\. Some of the logs that will grow the most and may need trimming are:

  • Console.log, this log will continue to grow while the SBS Console is running.
  • *.evtx files, these are the event logs before the setup of the server completed, they can be safely removed if the server has been in production and had no setup issues.
  • W3wp.log, in the C:\Program Files\Windows Small Business Server\Logs\WebWorkplace folder. This is the log for Remote Web Workplace.
  • The C:\Program Files\Windows Small Business Server\Logs\MonitoringServiceLogs folder. These are the logs for the Windows SBS Manager service.

POP3 Connector Badmail directory

If you are using the POP3 Connector, you may end up with emails that failed to be delivered (rejected by the local Exchange server) inC:\Program Files\Windows Small Business Server\Data\badmail. This folder will be automatically trimmed to 400mb once it reaches 450mb once a week.

The licensing log can consume a significant amount of hard disk space

This is discussed on the Windows Small Business Server 2008 Release Documentation 
You can delete the events in the Windows SBS 2008 licensing log to free up additional space on the hard disk drive.

To delete events in the Windows SBS 2008 licensing log

  1. From the server, open a Command Prompt window as an administrator. To do this, click Start, and then in the Search box, typecommand prompt.
  2. In the list of results, right-click Command Prompt, and then click Run as administrator.
  3. At the command prompt, type the following command: del "%systemroot%\system32\winevt\logs\Microsoft-Windows-Server Infrastructure Licensing*%4Debug.etl.*"

You can also use Registry Editor to disable the licensing log.

  1. Click Start, type regedit, and then press ENTER.
  2. In Registry Editor, locate and then click the following registry key: 
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerInfrastructureLicensing
  3. In the details pane, right-click TraceMask, and then click Modify.
  4. In the Edit DWORD dialog box, change the value for Value data to 0 (zero), and then click OK.
  5. Restart the server.

Windows Server Update Services (WSUS) Server Cleanup Wizard

In WSUS, you can delete unused updates and update revisions, computers not contacting the server, unneeded update files, expired updates and superseded updates. In order to accomplish this, you have to manually go through the WSUS Server Cleanup Wizard
To run the Server Cleanup Wizard :

  1. In the WSUS administration console (launch it from the Administrative Tools), select Options, and then Server Cleanup Wizard.
  2. By default this wizard will remove unneeded content and computers that have not contacted the server for 30 days or more. Select all possible options, and then click Next.
  3. The wizard will begin the cleanup process, and will present a summary of its work when it is finished, depending on the server performance, this may take a very long time. Click Finish to complete the process.

Very large SharePoint SQL transaction log file

Please read the following KB article for an explanation and instructions on how to prevent this: 
2000544 SBS 2008 BPA Reports that The Windows SharePoint Services configuration databases log file is getting large (currently over 1gb in size)

Active Directory Certificate Services transaction log files

When completing a critical or system state backup of the C: volume, a new transaction log will be generated under thec:\windows\system32\certlog\ folder. Removing these logs is only safe as long as the CA database file is consistent. In order to remove these logs and reclaim disk space, follow these steps:

  1. Open the Services MMC and stop the Active Directory Certificate Services service.
  2. Make a backup copy of ALL the file contents present in the c:\windows\system32\certlog\ folder.
  3. Delete EDB.CHK and all the files that have an extension of .LOG (*.LOG)
  4. Restart the Active Directory Certificate Services service.

Windows Component Clean Tool

The Windows Component Clean Tool (COMPCLN.exe) can be used to remove the files that are archived after Windows Vista SP2 or Windows Server 2008 SP2 is applied. It also removes the files that were archived after Windows Vista SP1 was applied, if they are found on the system. Running this tool is optional.

Installing Windows Server 2008 service packs increases the amount of disk space that is used by the operating system. This space is used to archive files so that the service pack can be uninstalled. Typically, you should run COMPCLN.exe if you want to reclaim this disk space after applying SP2 and if you will not need to uninstall SP2.

NOTE: You cannot uninstall Windows Vista SP2 or Windows Server 2008 SP2 after you run this tool on an image.

Move Data Wizards

We are not going to focus on these wizards on this post, but as a reference, SBS 2008 provides an automated way of moving the following:

  • Move Exchange Server Data: which moves both the exchange database file as well as your exchange transaction logs for all storage groups.
  • Move Windows SharePoint Services Data: Moves the SharePoint Content and Configuration databases.
  • Move Users’ Shared Data: Moves C:\Users\Shares\ directory and all sub directories 
  • Move Users’ Redirected Documents Data: Moves C:\Users\FolderRedirections\ directory and all sub directories
  • Move Windows Update Repository Data: Moves the repository data from C:\WSUS\WSUSContent and C:\WSUS\UpdateServicePackages. Please note it does NOT move the SUSDB Folder and the WSUS database which contains the metadata.
  • More Resources: 
    Manage Server Storage by using Windows SBS Console 
    Moving Data on Windows Small Business Server 2008 
    Introducing Server Storage Management in SBS 2008

Update #1 3/3: 
Added reference to WSUS Administration web site ID (Site Id 1372222313)
Added reference to Exchange 2007 BackPressure NDRs and errors due to low disk space

 

 

 

 

 

I've performed the commands in KB2000544, but cannot compact the database.  I get this error:

sqlcmd -S \\.\pipe\mssql$microsoft##ssee\query\ -E -i c:\batch\ps\logshrink.sql

HResult 0x2, Level 16, State 1

Named Pipes Provider: Could not open a connection to SQL Server [2].

Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..

Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

First make sure that you have a microsoft##ssee instance.  You can test connectivity by running "OSQL -S \\.\pipe\mssql$microsoft#

#ssee\sql\query\ -E".

Try typing the entire command rather than copy/paste.

Also, make sure you're logged in as the administrator account you installed SQL with (to make sure you have rights), and run from an elevated command prompt.

 

 

Compcln.exe /verbose:<log_file>