Using contig for single file defragmentation

From time to time you will need to use all available tools at your disposal. There are even times when you have to find a quick fix if not the a long term fix for a problem. The contig.exe is one such tool. You can download it from here. I ran across this particular tool when I have to gain access to a massive mailbox that had grown beyond normal sizes and consequently was also heavily fragmented. While normally I would use the build in Windows disk defragmentor in this case it would have taken to long, or even not been able to finish at all. This tool lets you analyze and fragment a single or group of files. Once I defragmented the single file I was able to open the target mailbox and start at least archiving unneeded messages. This can be used in any other situations as well to: a heavily fragmented database file, or even attempting to degragment DLL fiels for better performance.

Problem: How to defragment a single file
Fix: Download and copy the contig.exe file to your ‘/system32′ directory. open a command line windows and navigate to the directory that contains the file(s) you would like to defragment. type ‘contig <FILE(S)>’. IF you would like to see howdefragmented the file is you can use the ‘-a’ to analize your file in the following fashion: ‘contig -a <FILE(S)>’.

The Meaning of a Window Administrator

Many times working in the computer industry it can seem like a vast mystery to those outside of the field. You or I may easily point to programmer and say how different that field is from what an administrator might do. This is to say that you or I haven’t dealt with coding issues but it’s usually a pretty big stretch. To most of the outside world they hear computer and they assume that you know everything about everything that involves computer. This leads to the false perception whether fostered or misguided that we do know everything. At times this can be very beneficial but in the end I think more harm comes to us because we can’t always answer all of those questions. It was often that I was approached at a small company I worked for and asked about some excel scenarios that I couldn’t answer. After all my knowledge of Excel could be encapsulated with ‘autosum’. While I look as excel as a basic container for data and nothing more others see it as a powerful tool to accomplish their daily tasks. When they asked that crazy question they come away with is a diminished view of my technical abilities. Which in the end is the truth; after all I am a Windows administrator not an Excel guru. I don’t claim to be and my resume certainly doesn’t state this but when people see a computer people don’t realize that there is a difference.

            I crudely equate this to being a doctor as the field began to gain legitimacy. While doctors where all viewed as quacks during that field infancy there was a twinge of legitimacy. It doesn’t mean that there were some misguided people who set this belief back and hurt the medical field, but in the end the field matured and people came to recognize medicine as a legitimate science. Even to the point that people will now recognize the difference between a cardiologist and pediatrician.

            In some ways we are generalist much like the afore mentioned pediatrician and cardiologist. After all they have to know the human body and understand how to work in that particular field, but once you start asking specific questions about their particular fields you begin to see just how different they are. In this same way this is what I believe it is to be a Windows Administrator. Different that Linux administrator, Network Engineer, or programmer, but rooted in a common field. As we develop and mature in this field more of the general public will come to understand that difference between each of us.

SQL truncate logs

Some time when we get into a bind because of neglect or ignorance we have to rely on alternative methods to the normal GUI methods. One of these situation included when I had a computer with SQL server melt down on me because of the size of it’s transaction logs. As you may or may not know a grossly large transaction log compared to it’s data files can signal a problem. Normally you want to have some type of mantenance plan to keep these in check and everything running healthy. In other cases your client may not seek to do this and you are called in after the fact. In this particular case I could even get into the GUI to shring the log file so I had to resort to this little trick.

Problem: Use an alternative method to truncate SQL logs
Solution: In command line interface you want to start SQL with a trusted connection using the following  command: ‘sqlcmd -S<SERVERNAME> -E’. The ‘S’ switch indicates which server and the ‘E’ switch establish a trusted connection. Next you should see a ‘>’ prompt. From there you can type the following:

>backup log <DATABASE> with truncate_only
>go
>dbcc shrinkdatabase(‘<DATABASE>’)
>go
>quit

This will work with a single database which can be a bit painful if you have alot of transaction logs but it should get you started in the right direction.

Drive mapping in Terminal services part 2

This is one of those quirky issue that will not go away. As we noted in my steps from an earlier post Drive mapping in Terminal services this should have let your user be able to connect via an RDP session and use the clinet mapped drives. As some you have noted this doesn’t always work. I’ve done a bit more research and found that sometimes you need to take an extra step. Please note that this requires a registry hack. If you are not confortable please use backup or find someone who is more capable to give you a hand.

Problem: Original Drive mapping in Terminal services steps still don’t show mapped drives
Fix: Open you registry editor on the server using ‘regedit’. browse to the following key:
‘HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWdsrdpwdfEnablePrintRDR’. change the value from 0 to 1.

I’m not sure why changing the print redirector has any bearing on this particular problem, but it seems to do the trick once you log off and log on once again.

Identify an Isolated IIS FTP site

As I have come to notice alot of times there are too many chefs in the administration kitchen. Often there are requests that are filled but never documented. In such cases it is always best to check an environment out before you start to make changes of your own. In one particular instance manipulating FTP sites in IIS 6.0 can be particularly problematic. Ever since IIS 6 was released a new feature called isolated FTP came as a welcome feature but in typical Microsoft fashion is lacked some basic user functionalities. How can you identify a isolated FTP site? or change an established isolated FTP site to a regular site?

You might think why go through all of this trouble when it would be easier to delete and recreate? In some cases this is not always appropriate. After all this is someone else’s server and often just deleting things causes more problems that fixes.

Problem: identify or change an IIS 6 isolated FTP site
Fix: First open IIS manger and navigate to your FTP sites folder. Note the identifier of the FTP site in question. The identifier is usually some random but unique 9 digit number. Next, open your IIS metabase explorer. If you don’t already have the IIS metabase explorer you can find it here. Navigate to <server name> -> LM -> MSFTPSVC -> <identifier number>. At this point the panel on the right should be showing to much information, the vital information will have to be reveled. On the menu bar select ‘view’ and enaable both ‘Inherited Data’ and ‘Secure Data’. The right hand panel should now show much more information. The particular value of intrest to us is:

  • ID: 5012
  • Name: UserIsolationMode
  • Data Type: DWORD

The Data will determine the type of FTP site it is:

  • 0: standard FTP site
  • 1: isolated FTP site
  • 2: isolated FTP site using active directory

You can of course change these values but do so with care.