OVH Cloud OVH Cloud

Trouver l'emplacement de son pst dans la base de registre

6 réponses
Avatar
Stephane
Bonjour,

J'ai récupéré un script vbs permettant de copier le fichier pst d'un
utilisateur vers un dossier qui est sauvegardé. Ce script fonctionne très
bien mais je dois spécifier en dur l'emplacement du fichier pst dans le
script.

J'aimerai pouvoir lire cet emplacement en base de registre pour que si
jamais l'utilisateur à déplacer son pst la sauvegarde puisse se faire quand
même.

Sauf que j'ai pas encore trouvé en base de registre ou trouvé l'emplacement
du fichier pst utilisé par outlook ??

Est ce que vous connaissez comment récupérer ça dans la bdr ?

Pour info les users sont sous outlook 2003 et 2000.

Cordialement,
Stéphane

6 réponses

Avatar
JièL
Bonjoir(c) Stephane

Bonjour,

J'ai récupéré un script vbs permettant de copier le fichier pst d'un
utilisateur vers un dossier qui est sauvegardé.


En clair, ce script fait une copie du PST ?! Pourquoi ne pas prendre
alors le prog de MS qui fait la même chose à intervale régulier, voire à
la fermeture d'Outlook ?

PFBACKUP qu'y se nomme, et vous le trouverez sur la FAQ

Pour info les users sont sous outlook 2003 et 2000.


Compatible avec toutes les versions d'Outlook

Cordialement,


--
JièL / Jean-Louis GOUBERT
Là bas mieux qu'en face ;-) http://forums.offices.free.fr/
La FAQ Outlook est là : http://faq.outlook.free.fr/
Les stats CDO : http://faq.outlook.free.fr/cdo/

Avatar
Oliv'
*Stephane que je salut a écrit *:
Bonjour,

J'ai récupéré un script vbs permettant de copier le fichier pst d'un
utilisateur vers un dossier qui est sauvegardé. Ce script fonctionne
très bien mais je dois spécifier en dur l'emplacement du fichier pst
dans le script.

J'aimerai pouvoir lire cet emplacement en base de registre pour que si
jamais l'utilisateur à déplacer son pst la sauvegarde puisse se faire
quand même.

Sauf que j'ai pas encore trouvé en base de registre ou trouvé
l'emplacement du fichier pst utilisé par outlook ??

Est ce que vous connaissez comment récupérer ça dans la bdr ?

Pour info les users sont sous outlook 2003 et 2000.

Cordialement,
Stéphane


je ne crois pas que cette info soit disponible elle est de mémoire codée en
binaire dans une clef du registre.


--
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have a nice day
Oliv'
Pour me joindre : http://cerbermail.com/?V8r2o1YHl4
les sites références:
Excel :http://www.excelabo.net http://xcell05.free.fr/
http://dj.joss.free.fr/
http://frederic.sigonneau.free.fr/ http://www.excel-vba-francais.com/
Word : http://faqword.free.fr/
Outlook : http://faq.outlook.free.fr/
les archives : http://groups.google.com/group/microsoft.public.fr.outlook
OE6 : http://www.faqoe.com/
Sql : http://sqlpro.developpez.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Avatar
Stephane
La raison est une question de déploiement.

On ne veut pas passer sur chaque pour l'installer.

J'avais vu sur un forum qu'il etait difficile de le déployer massivement.
Pas possible de générer un msi. Vu qu'il y a environ 40 postes la manip
risque d'être un peu longé !!

D'ou l'utilisation d'un script :(

Mais apparemment si l'info est codé en bdr, ça risque d'être compliqué !!

Cordialement,
Stéphane


Bonjoir(c) Stephane

Bonjour,

J'ai récupéré un script vbs permettant de copier le fichier pst d'un
utilisateur vers un dossier qui est sauvegardé.


En clair, ce script fait une copie du PST ?! Pourquoi ne pas prendre
alors le prog de MS qui fait la même chose à intervale régulier, voire à
la fermeture d'Outlook ?

PFBACKUP qu'y se nomme, et vous le trouverez sur la FAQ

Pour info les users sont sous outlook 2003 et 2000.


Compatible avec toutes les versions d'Outlook

Cordialement,


--
JièL / Jean-Louis GOUBERT
Là bas mieux qu'en face ;-) http://forums.offices.free.fr/
La FAQ Outlook est là : http://faq.outlook.free.fr/
Les stats CDO : http://faq.outlook.free.fr/cdo/




Avatar
Stephane
mince :(

On peut rien faire alors!! pas posible de décoder :)

Merci

Stéphane



*Stephane que je salut a écrit *:
Bonjour,

J'ai récupéré un script vbs permettant de copier le fichier pst d'un
utilisateur vers un dossier qui est sauvegardé. Ce script fonctionne
très bien mais je dois spécifier en dur l'emplacement du fichier pst
dans le script.

J'aimerai pouvoir lire cet emplacement en base de registre pour que si
jamais l'utilisateur à déplacer son pst la sauvegarde puisse se faire
quand même.

Sauf que j'ai pas encore trouvé en base de registre ou trouvé
l'emplacement du fichier pst utilisé par outlook ??

Est ce que vous connaissez comment récupérer ça dans la bdr ?

Pour info les users sont sous outlook 2003 et 2000.

Cordialement,
Stéphane


je ne crois pas que cette info soit disponible elle est de mémoire codée en
binaire dans une clef du registre.


--
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have a nice day
Oliv'
Pour me joindre : http://cerbermail.com/?V8r2o1YHl4
les sites références:
Excel :http://www.excelabo.net http://xcell05.free.fr/
http://dj.joss.free.fr/
http://frederic.sigonneau.free.fr/ http://www.excel-vba-francais.com/
Word : http://faqword.free.fr/
Outlook : http://faq.outlook.free.fr/
les archives : http://groups.google.com/group/microsoft.public.fr.outlook
OE6 : http://www.faqoe.com/
Sql : http://sqlpro.developpez.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






Avatar
Oliv'
*Stephane que je salut a écrit *:
mince :(

On peut rien faire alors!! pas posible de décoder :)


Peut être j'ai trouvé un VBscript je le teste et reviens !!

--
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have a nice day
Oliv'
Pour me joindre : http://cerbermail.com/?V8r2o1YHl4
les sites références:
Excel :http://www.excelabo.net http://xcell05.free.fr/
http://dj.joss.free.fr/
http://frederic.sigonneau.free.fr/ http://www.excel-vba-francais.com/
Word : http://faqword.free.fr/
Outlook : http://faq.outlook.free.fr/
les archives : http://groups.google.com/group/microsoft.public.fr.outlook
OE6 : http://www.faqoe.com/
Sql : http://sqlpro.developpez.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Avatar
Oliv'
*Stephane que je salut a écrit *:

J'aimerai pouvoir lire cet emplacement en base de registre pour que
si jamais l'utilisateur à déplacer son pst la sauvegarde puisse se
faire quand même.




Il s'agit d'un à l'origine d'un VBscript
http://www.outlookcode.com/codedetail.aspx?id60
qui ne fonctionnait pas tel quel sur mon poste alors je l'ai modifié en vba.



Il enregistre dans un fichier csv le résultat (en double je sais pas
pourquoi ) dans MES DOCUMENTS.

A peaufiner donc

Ci dessous ou pendant 21 jours http://cjoint.com/?juo323AUfE

Oliv'

'====================================================================================== 'This vbscript is used to read all the outlook profiles for that user from
the registry
'to check for all types of PSTs (Archive, Personal Folders). It writes to
'a CSV file the path of the PST, the computer name its on, the username of
the
'person logged on and the size of the PST. It then overwrites the path to
the
'registry depending on the path required. Specially usefull when doing a
migration.
'I am sure there is a much better way to write this code because there is a
lot
'of repetition and i have no more time to do this so i will let you guys do
that ;)
'It should work for outlook versions from 2000 and 2003.
'
'By: Carlos Bueno modifié par Oliv'
'=======================================================================================
Const HKEY_CURRENT_USER = &H80000001
Const BASE_KEY = "SoftwareMicrosoftWindows NTCurrentVersionWindows
Messaging SubsystemProfiles"
Public fso, oNetwork, ws, ws2, objFileSystem
Public strComputer, tinyKeyPath, strOutputFile, objOutputFile, strInfo,
strInfo2, BinOrStr, objreg, arrSubKeys


Sub pst_where()


'the network object used to connect to the network
Set oNetwork = CreateObject("WScript.Network")

'two objects to shell script.
Set ws = CreateObject("WScript.Shell")
Set ws2 = CreateObject("WScript.Shell")

'object used for later on getting the size of the PSTs
Set fso = CreateObject("Scripting.FileSystemObject")
strComputer = "."

'gets username of the person logged on
strInfo = oNetwork.UserName

'gets the computer name
strInfo2 = oNetwork.ComputerName

'A list of object required to write to the csv file and a variable that
'contains the name of the file (partial logged username). This is going
'to be used to write the data from the registry to the file along with
'logged on username and computer name.
strOutputFile = strInfo & "-pstpath.csv"
Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, True)

'object used to connect to the registry
Set objreg = GetObject("winmgmts:{impersonationLevel=impersonate}!" &
strComputer & "rootdefault:StdRegProv")

'This enumarates all the different profiles for the user
objreg.EnumKey HKEY_CURRENT_USER, BASE_KEY, arrSubKeys

'selects each profile
For Each subkey In arrSubKeys
subKeyPath = BASE_KEY & "" & subkey

'This enumerate the subkeys of each profile and exposing
'the items that contain the data
objreg.EnumKey HKEY_CURRENT_USER, subKeyPath, arrTinyKeys

'selects each subkey within the profile
For Each tinyKey In arrTinyKeys
tinyKeyPath = subKeyPath & "" & tinyKey

'resets the string to empty. Includes flags
PSTPath = ""
PSTPath5 = ""
PSTPath4 = ""
PSTPath6 = ""
myFlag = 0
BinOrStr = 0
'--------------------------------------------------------------------------------------
'Outlook 2000 reading and writting
'--------------------------------------------------------------------------------------
' On Error Resume Next
' PSTKeyName4 = "HKCU" & tinyKeyPath & "01e6700"
' strValue4 = ws.RegRead(PSTKeyName4)
' If Err Then
' Else
' If strValue4 <> 0 Then
' PSTPath4 = PSTPath4 & strValue4
' End If
'
'
' w = WriteToFilecsv(PSTPath4, PSTKeyName4)
'
'
' PSTKeyName5 = "HKCU" & tinyKeyPath & "1020fff"
' strValue5 = ws.RegRead(PSTKeyName5)
' For L = LBound(strValue5) To UBound(strValue5)
' If strValue5(L) <> 0 Then
' PSTPath5 = PSTPath5 & Chr(strValue5(L))
' End If
' Next
'
' PSTPath5 = Replace(PSTPath5, "8+*Vmspst.dllNITA7n",
"")
' w = WriteToFilecsv(PSTPath5, PSTKeyName5)
' End If
' Err.Clear
'----------------------------------------------------------------------------------------
'Outlook 2003 reading and writting
'----------------------------------------------------------------------------------------
On Error Resume Next
PSTKeyName = "HKCU" & tinyKeyPath & "01f6700"
strValue = ws.RegRead(PSTKeyName)
If Err Then
Else
For L = LBound(strValue) To UBound(strValue)
If strValue(L) <> 0 Then
PSTPath = PSTPath & Chr(strValue(L))
End If
Next

w = WriteToFilecsv(PSTPath, PSTKeyName)
PSTKeyName6 = "HKCU" & tinyKeyPath & "1020fff"
strValue6 = ws.RegRead(PSTKeyName6)

For L = LBound(strValue6) To UBound(strValue6)
If strValue6(L) <> 0 Then
PSTPath6 = PSTPath6 & Chr(strValue6(L))
End If
Next

PSTPath6 = Replace(PSTPath6, "8+*Vmspst.dllNITA7n",
"")
w = WriteToFilecsv(PSTPath6, PSTKeyName6)

End If
Err.Clear
Next
Next

'close and assign to nothing the object used to write to file
objOutputFile.Close
Set objFileSystem = Nothing

MsgBox "Finished outlook PST check..."
End Sub
'------------------------------------------------------------------------------------------------------
'The following two functions builds the hex number from a string and creates
'a binary variable that contains the data in bytes since the data
'needs to be in byte format in order to be entered onto the the registry.
'Also it adds back on the start of the string the hex number of the data
that
'was "replaced" earlier just after reading from the registry.
Public Function StringToByteArray(Data, NeedNullTerminator)
Dim strAll
strAll = StringToHex4(Data)
If NeedNullTerminator Then
If BinOrStr = 2 Then
'2000
strAll =
"0000000038A1BB1005E5101AA1BB08002B2A56C200006D737073742E646C6C00000000004E495441F9BFB80100AA0037D96E000000"
& strAll
strAll = strAll & "00"
End If
If BinOrStr = 1 Then
'2003
strAll =
"0000000038A1BB1005E5101AA1BB08002B2A56C200006D737073742E646C6C00000000004E495441F9BFB80100AA0037D96E00000000"
& strAll
strAll = strAll & "0000"
End If
If BinOrStr = 3 Then
'2003
strAll = strAll & "0000"
End If
End If
intLen = Len(strAll) 2
ReDim arr(intLen - 1)
For i = 1 To Len(strAll) 2
arr(i - 1) = CByte("&H" & Mid(strAll, (2 * i) - 1, 2))
Next
BinOrStr = 0
StringToByteArray = arr
End Function

'returns the value as a hex number with the 00 added
Public Function StringToHex4(Data)
Dim strAll
For i = 1 To Len(Data)
strChar = Mid(Data, i, 1)
If myFlag = 0 Then
strTemp = Right("00" & Hex(AscW(strChar)), 4)
strAll = strAll & Right(strTemp, 2) & Left(strTemp, 2)
Else
strTemp = Hex(AscW(strChar))
strAll = strAll & Right(strTemp, 2)
End If
Next
myFlag = 0
StringToHex4 = strAll
End Function

'----------------------------------------------------------------------------------------------------------------
'function to write the data onto a csv file where the path in the registry
was changed for the psts
Public Function WriteToFilecsv(myPath, myPSTKeyName)
myFsize = FormatNumber(fso.GetFile(myPath).Size, 0, , -1)
v = Split(tinyKeyPath, "")
myProfName = Trim(v(6))
objOutputFile.WriteLine (strInfo & ";" & strInfo2 & ";" & myPath & ";" &
myProfName & ";" & myFsize & ";" & myPSTKeyName)
End Function