Something like this should work. I dont have a server to test it on, so Im kind of guessing about the registry key to read.

 Code:
$new_prof = ReadValue("HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList","centralprofile")
$old_prof = Left($new_prof,-3)