Monthly Archive for September, 2008

IdleTunes – Dead Tracks – ITunes

I store music files across multiple harddrives and move them around a lot as I download and what not. The resuling moves often create dead track in Itunes and since I’m making a lot of moves – I hate having to reupdate the tracks in ITunes manually.

I found a utility called idletunes which helps with removing those pesky (!) dead tracks under ITunes. I know you can hit delete. It seems like there should be a search field by missing track. If it is in ITunes, I couldn’t find it.

If found another tool called the ITunes Library Updater which seems to perform a similar function and much closer to what I was looking for.

OVAL – Windows Script – Database

Working on a way to periodically scan my systems for known security problems using the OVAL security definitions.

I downloaded the client and copy to my systems using something I have dubbed the Poor Man’s Systems Administration Kit (PSAM) and another job scheduling program called Visual Cron.

There are two scripts. One is ran locally on the system being scanned for security configuration weaknesses from the OVAL definitions. The other is a script to process the resulting html files generated by the ovaldi.exe program shipped with OVAL.

For the scripts to work, you will first need to setup a DSN within the script. The database behind the DSN  holds the results of the scans. Here is the code for the database / table on Microsoft SQL Server.

The first script is ran and dumps the results of the ovaldi scan into a common folder repository on a central server.

The next script is a vbscript and processes the directory that contains the output oval html files.

Please note, that the script needs to be ran using cscript.exe from \windows\syswow64 on 64 bit machines.  This took me almost a whole day to figure out! You’ll also need to setup the dsn using the odbccad.exe util from syswow64.

Here is the oval html output processing script.

Script to Extract Email Addresses from AD

I had needed to setup a unix based mail gateway to relay mail through to Exchange on one of my networks.

I had found an article on how to do this The script below reflects a modification of a script I found Mail Relay/; however, it needed some adjustment.

I made some modifications below to handle contacts and groups.

‘ Export all valid recipients (= proxyAddresses) into a
‘ file virtual.txt

‘ Ferdinand Hoffmann & Patrick Koetter
‘ 20021100901
‘ Shamelessly stolen from
‘ \
‘ planning/activedirectory/bulksteps.asp

‘Global variables
Dim Container
Dim OutPutFile
Dim FileSystem

‘Initialize global variables
Set FileSystem = WScript.CreateObject(“Scripting.FileSystemObject”)
Set OutPutFile = FileSystem.CreateTextFile(“virtual.txt”, True)
Set Container=GetObject(“LDAP://DC=local,DC=p2sol,DC=com”)

‘Enumerate Container
EnumerateUsers Container

‘Clean up
Set FileSystem = Nothing
Set Container = Nothing
Dim Alias

‘Say Finished when your done
WScript.Echo “Finished”

‘List all Users
Sub EnumerateUsers(Cont)
Dim User

‘Go through all Users and select them
For Each User In Cont
Select Case LCase(User.Class)

Case “contact”
If Not IsEmpty(User.Mail) Then
OutPutFile.WriteLine “alias: SMTP ” & User.Mail
End If

‘If you find groups
Case “group”
‘Select all proxyAddresses
If Not IsEmpty(User.proxyAddresses) Then
For Each Alias in User.proxyAddresses
OutPutFile.WriteLine “alias: ” & Alias
‘WScript.Echo Alias
End If

‘If you find Users
Case “user”
‘Select all proxyAddresses
If Not IsEmpty(User.proxyAddresses) Then
For Each Alias in User.proxyAddresses
OutPutFile.WriteLine “alias: ” & Alias
‘WScript.Echo Alias
End If

Case “organizationalunit” , “container”
EnumerateUsers User

End Select
End Sub