The Win2k (and NT4) ResKits have some Perl scripts that will do this for you. I have used one in the past to establish owners then 'pruned' the output to a format usable by my script.