Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用VBScript在注册表中查找Outlook帐户信息?_Vbscript_Outlook_Registry - Fatal编程技术网

如何使用VBScript在注册表中查找Outlook帐户信息?

如何使用VBScript在注册表中查找Outlook帐户信息?,vbscript,outlook,registry,Vbscript,Outlook,Registry,我正在尝试创建一个关于我管理的广告成员的用户帐户信息的报告。具体来说,我需要在Outlook安装中配置哪些帐户;他们使用的是哪种协议POP/IMAP,相关的PST文件存储在哪里以备备份。我认为我可以在所有可以写入共享位置的文件的机器上部署VBScript,然后可以检索该文件。 我在网上找到了一些脚本,它们可以在HKCU..\Windows Messaging Subsystem\Profiles中找到PST文件的位置,但无法理解它们是如何解析十六进制键的。如果我能弄明白,我可能会得到子键上存储的

我正在尝试创建一个关于我管理的广告成员的用户帐户信息的报告。具体来说,我需要在Outlook安装中配置哪些帐户;他们使用的是哪种协议POP/IMAP,相关的PST文件存储在哪里以备备份。我认为我可以在所有可以写入共享位置的文件的机器上部署VBScript,然后可以检索该文件。 我在网上找到了一些脚本,它们可以在HKCU..\Windows Messaging Subsystem\Profiles中找到PST文件的位置,但无法理解它们是如何解析十六进制键的。如果我能弄明白,我可能会得到子键上存储的其他信息。
如果您能帮助解决这个问题,我们将不胜感激。

最终通过在线指针解决了这个问题。这基本上是从指定的子项向下循环到注册表中的三个级别,并将其写入文件

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"
它仍然写入十六进制值。PST位置存储在配送商店EntryID中,帐户名和电子邮件存储在帐户名和电子邮件中。所有存储为REG_二进制文件。 如何在最后一个循环中获得REG_二进制格式的ASCII输出