Can I use Windows Management Instrumentation (WMI) to translate a SID to a username?

Yes you can, by using the WMI Win32_SID class, as the script in Listing 1, page 9, shows. To use this script, simply change the value assigned to the strSID variable to the SID you want to translate.