One line administration – search and delete computer accounts

Here’s a quick one-line script I’ve been using to clean up some old computer accounts in active directory. It requires the dsquery and dsrm tools from the Server 2003 Admin Pack or the Remote Server Administration Toolkit.

@for /f %%a in ('DSQUERY COMPUTER -NAME *%1') do (dsrm %%a)

Save that in as a batch file and it’ll query Active Directory for computers including the argument passed.  Here’s an example with a naming structure where we have the last 4 digits of the MAC address in the name for uniqueness.

C:\>adrm.cmd 6736
C:\>(dsrm "CN=LABPC6736,OU=Labs,DC=yakk0,DC=org" )
Are you sure you wish to delete CN=LABPC6736,OU=Labs,DC=yakk0,DC=org (Y/N)? y
dsrm succeeded:CN=LABPC6736,OU=Labs,DC=yakk0,DC=org

Fun with icacls

We’ve been having some random problems at work with various software packages and have tracked it down to folder redirection policies and permissions. It appears that years ago people couldn’t get folder redirection working right and rigged it up with some registry hacks and scripts. It works fine in 2000, which most of our users use, but breaks in Vista because Vista doesn’t like to redirect to a drive letter. In particular we were noticing the Application Data was partially on the network share and partially on the local drive. The other thing we’ve noticed is the permissions on the folders aren’t set properly. Following Microsoft’s recommended settings for permissions and redirection policy, we tested and sure enough things started working.

Read more

Presented in glorious surround sound

My wife and I have been without surround sound since we got our HDTV last year. When I first got into home theater sound systems I got a “home theater in a box” kit with a receiver that was also a 5-disc DVD changer. Because we now had a HDTV, I wanted to have the best visual appearance for our DVDs and got an upconverting DVD player. The problem was that the DVD player wouldn’t connect to the receiver, which makes sense…why would you have a standalone DVD player when you have 5 built-in? Another problem was the audio from our TivoHD. The old receiver had no HDMI inputs. Because of this, we pretty much only used the receiver for listening to radio. Around the time we moved the DVD player in the unit completely died, so it didn’t make the move with us. We have been using just the speakers in the TV since, and it’s been a good experience. I really wanted a new receiver though. Not only for the audio, but I wanted a good HDMI switcher and upconverter for my non-HD stuff. Thanks to my newly employed status and our tax refund I’m now the owner of a Onkyo TX-SR806 Receiver.

Read more

Fun With Virtualization (pt. 2)

This is an addendum to the previous post. After having things reasonably set up, but unhappy with some performance, I decided to scrap everything and try VMWare ESXi. I wiped the computer and got ESXi installed…then realized that it won’t support the Realtek gigabit ethernet card I have in the system.

I’ve now put Windows Server 2008 back on in the Server Core mode and am running nothing but Hyper-V on it. I think some of my problems were tyring to do too much with the base OS, and if I can’t have something as light as ESXi, I’ll do the best I can with this. Thankfully, I still had my VMs saved, but I decided to rebuild my XP one because it was too slow. It was converted from an old desktop I had last year and needed to be dumped. Both the Server 2008 and XP VMs are working fine.

My Drobo however…I’m still trying to diagnose what’s going on with it.

Fun with virtualization

Part one of my home computing infrastructre is done. I am moving from the free VMWare Server to Hyper-V on Windows Server 2008 R2 Beta (thanks to my Technet subscription). VMWare Server is nice, but a little slow. Hyper-V is something I’ve wanted to play with for a while, but I was also considering VMWare ESXi, which is a free version of their enterprise ESX server. I settled on Hyper-V moved everything off my server onto my Drobo.

Read more