2011-11-02 2 views
0

내가 관리하는 광고 회원에 대한 사용자 계정 정보 보고서를 만들려고합니다. 특히 Outlook 설치시 구성되는 계정이 필요합니다. 그들이 사용하는 프로토콜 종류 (POP/IMAP)와 백업 목적으로 저장된 PST 파일의 위치 나는 공유 위치의 파일에 쓸 수있는 모든 컴퓨터에 VBScript를 배포 할 수 있으며 그 파일을 다시 검색 할 수 있다고 생각합니다. HKCU .. \ Windows Messaging Subsystem \ Profiles에서 PST 파일 위치를 찾을 수있는 온라인 스크립트를 찾았지만 어떻게 Hex 키를 구문 분석하는지 이해할 수 없었습니다. 알아낼 수 있다면 하위 키에 저장된 다른 정보를 얻을 수 있습니다. 해결 방법에 대한 도움을 주시면 감사하겠습니다.VBScript를 사용하여 레지스트리에서 Outlook 계정 정보를 찾는 방법은 무엇입니까?

답변

0

마지막으로 온라인에서 포인터를 사용하여 알아 냈습니다. 이것은 기본적으로 지정된 하위 키에서 레지스트리의 세 가지 수준으로 반복되어 파일에 씁니다.

const HKCU = &H80000001 
Const REG_SZ  = 1 
Const REG_EXPAND_SZ = 2 
Const REG_BINARY = 3 
Const REG_DWORD  = 4 
Const REG_MULTI_SZ = 7 
strComputer = "." 
Set StdOut = WScript.StdOut 
Dim objFSO :Set objFSO = CreateObject("Scripting.FileSystemObject") 
Dim objPSTLog :Set objPSTLog = objFSO.OpenTextFile("%temp%\pst.log",8,True) 

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv") 

strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" 
oReg.EnumKey HKCU, strKeyPath, arrSubKeys 

For Each subkey In arrSubKeys 
    objPSTLog.WriteLine(subkey) 
    strkeyPath1 = strkeyPath & subkey 'Outlook 
    oReg.EnumKey HKCU, strKeyPath1, arrSubKeys1 
    if IsArray(arrSubKeys1) Then 
     For Each subkey1 In arrSubKeys1 
      strkeyPath2 = strkeyPath1 & "\" & subkey1 'Outlook\8bce72417aa40d418ab879690e9b39cc etc 
      oReg.EnumKey HKCU, strKeyPath2, arrSubKeys2 
      if IsArray(arrSubKeys2) Then 
       For Each subkey2 In arrSubKeys2 
        objPSTLog.WriteLine(subkey2) 
        strkeyPath3 = strkeyPath2 & "\" & subkey2 'Outlook\8bce72417aa40d418ab879690e9b39cc\0000001 etc 
        oReg.EnumValues HKCU, strKeyPath3, arrValueNames, arrTypes 
        if IsArray(arrValueNames) Then 
         For i = lBound(arrValueNames) To uBound(arrValueNames) 
          strValueName = arrValueNames(i) 
          Select Case arrTypes(i) 

           ' Show a REG_SZ value 
           ' 
           Case REG_SZ   
           oReg.GetStringValue HKCU, strKeyPath3, strValueName, strValue 
           objPSTLog.WriteLine(" " & strValueName & " (REG_SZ) = " & strValue) 

           ' Show a REG_EXPAND_SZ value 
           ' 
           Case REG_EXPAND_SZ 
           oReg.GetExpandedStringValue HKCU, strKeyPath3, strValueName, strValue 
           objPSTLog.WriteLine(" " & strValueName & " (REG_EXPAND_SZ) = " & strValue) 

           ' Show a REG_BINARY value 
           '   
           Case REG_BINARY 
           oReg.GetBinaryValue HKCU, strKeyPath3, strValueName, arrBytes 
           strBytes = "" 
           For Each uByte in arrBytes 
            uByte = Hex(uByte) 
            strBytes = strBytes & uByte & " " 
           Next 
           objPSTLog.WriteLine(" " & strValueName & " (REG_BINARY) = " & strBytes) 

           ' Show a REG_DWORD value 
           ' 
           Case REG_DWORD 
           oReg.GetDWORDValue HKCU, strKeyPath3, strValueName, uValue 
           objPSTLog.WriteLine(" " & strValueName & " (REG_DWORD) = " & CStr(uValue)) 

           ' Show a REG_MULTI_SZ value 
           ' 
           Case REG_MULTI_SZ 
           oReg.GetMultiStringValue HKCU, strKeyPath3, strValueName, arrValues        
           objPSTLog.WriteLine(" " & strValueName & " (REG_MULTI_SZ) =") 
           For Each strValue in arrValues 
            objPSTLog.WriteLine(" " & strValue) 
           Next 
          End Select 
         Next 
        End If 
        strKeyPath3="" 
       Next 
      End If 
      strKeyPath2="" 
     Next 
     strkeyPath1 = "" 
    End If 
Next 


objPSTLog.WriteLine("") 
objPSTLog.WriteLine("--------------------------------------------------------------------------------------------------------------") 
objPSTLog.WriteLine("") 
objPSTLog.close 

MsgBox "Script Run Successful" 

여전히 16 진수 값을 씁니다. PST 위치는 "Delivery Store EntryID", 계정 이름 및 "Account Name"& "Email"의 이메일에 저장됩니다. 모두 REG_BINARY로 저장됩니다. 마지막 루프의 REG_BINARY 케이스에서 ASCII 출력을 얻으려면 어떻게합니까?

관련 문제