Delegate control to disable/enable user accounts

DelegateI have a user I want to be able to disable or enable other domain user accounts without giving that user to much permissions. I spent some time Googling and on Microsoft’s support site and couldn’t find a specific permission that allowed just that. I found one that allows you to delegate the ability to unlock a user account. After playing with this for a couple of hours I grew to appreciate the complexity and power Active Directory gives an administrator over a domain. What I finally ended up using was a permission that allows for the user to enable/disable as well as change anything in the account options window on the Account tab. A bit more than I wanted to give, but not a problem in my case.

Right-click your domain and select delegate control. The delegate control wizard starts, click next to begin. Next select the users or groups that you want to delegate the responsibility to. In my case I have a group called “DisableEnableUsers” that I want to give the ability to disable/enable user accounts.

Next select create custom task to delegate radio button and hit next. On the “Delegate control of:” dialog select “Only the following objects” and scroll down to “User Objects” hit next. Put a check in the “General” box on the “Show these permissions:” window. Scroll down to the “Read and Write Account Restrictions.” Hit next and finish.

Now the users and or groups you delegated control to “Read and Write Account Restrictions” will be able to disable or enable user accounts.

Cleanly shrink transaction log on a SQL Server database

SQL ServerSQLServerOne of our database’s transaction log had grown to over 5gig. Considering the actual size of the database itself and the amount of activity this is huge. Plus it slows down our back-ups and just generally bugs me.

So, first I’ll tell you how not to try and clean it up. Don’t goto the Enterprise manager and right click on the database and select “Take Offline.” The next thing you don’t want to do is go and delete the transaction log file now that the database is offline. This sounds like a good idea and yet it’s not. When you goto bring the database back online it will kick and scream and throw fits and generally not work. Plus if the transaction log is large like say 5gig, it’s too big to send to the recycle bin and it gets permanently deleted.

The way you should shrink the size of the transaction logs is this:
a) Detach the database using sp_detach_db procedure (before that ensure no processes are using the database files.) Open query analyzer and type: “sp_detach_db ‘DB Name'” then execute query.
b) Delete the log file. (I feel more safe simply renaming it before deleting it.)
c) Attach the database again using sp_attach_db procedure.
This will tell the database server that the database was closed cleanly and it will proceed to create a new transaction log.

Update 10/03/06: We’ve since switched to using the following command to shrink our transaction log:

backup log “databasename” with Truncate_only
DBCC SHRINKFILE (‘databasename_log’,truncateonly)

It’s been pointed out to us that detaching the database is not a safe way to shrink your transaction log. We stand corrected! :)

Add record count to Frontpage Database Results

Frontpage DRWI’m not a huge Frontpage fan for the most part, but when it comes to creating ASP pages with database results it does do a good job. There are some things that it lacks, but overall you can get a nicely formatted report that is easily distributable through an intranet.

One of the things I had thought when working on past ASP pages is the lack of a record count. After some poking around the newsgroups (gotta love Usenet!) I found some pieces of code that I finally tweaked and experimented with enough to add a record count to an ASP page containing Frontpage Database Results.

The main piece that generates the count is this:

Now, the placement of this little bit of code is key. You need to switch to code or split view so you can past this into the actual HTML. It needs to be within the database results region. If you place it in certain places on the page, Frontpage, being the clever helper, will simply remove it. If you place it to high in the results region you will get a count but it will be off by one. The reason for this is because it’ll start with 0 as the first record. So, it really needs to be at the end of the results region.

After playing around a bit I found it works best just below the table holding the database results. I added the following:

 
Records: < %=fp_iCount%>

DBEnd

Remove Nero Scout from Windows Explorer

Nero ScoutI’ve used Nero almost exclusively for burning for several years now. I recently purchased the latest version and installed the whole thing. It now comes with a bunch of applications 90% of which I care nothing about. One new annoyance, in my opinion, is something called Nero Scout.

Truthfully I don’t even know what it is. It looked like something for finding and cataloging media files. I have my ways and methods and don’t need a new tool for this. It puts an annoying icon in my Windows Explorer that I don’t want there. I’m very particular about my computers and I don’t want anything extra floating around anywhere. So I figured it must have been installed with all the extra junk and it must go away if I remove all of the Nero applications except the actual burning part. Wrong. It was still there after un-installing all the rest. So after some poking around the web I found the following commands to remove the little pest. Goto Start/Run and execute one of these. It simply un-registers the dll associated with Nero Scout.

Remove Nero Scout:
regsvr32 /u “%commonprogramfiles%\Ahead\Lib\MediaLibraryNSE.dll”

Put it back:
regsvr32 “%commonprogramfiles%\Ahead\Lib\MediaLibraryNSE.dll”

Thanks to DjLizard.net for the info

Left behind

Left behind

I went for a drive looking for something to shoot and saw this old abandoned building. I walked around it and though there were many broken windows there was no easy way in. So I settled for shooting through a couple of the broken windows. I wanted so badly to go in and wander around, but I’d either have to jump a barbed wire fence or break more windows and I didn’t figure that was a good idea.