View Single Post
  #4  
Old November 24th 07, 12:38 AM posted to microsoft.public.outlook.installation
stovetopp77
external usenet poster
 
Posts: 1
Default PRF problem with PST password -

A solution that might work for you is to prompt the user for their password
using a scripting language and then build the PRF on-the-fly (ex. save it to
the user's profile), then launch the newly created, customized PRF.

Note: Code below assumes a default PRF file stored in \\mydomain\NETLOGON

Example Script:
'Start of script
title = "Configure Outlook with PRF"

'File manipulation constants
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

debugmode = 1
LDAPDisplayName = 1
checkPrevious = 1

service = "LDAP"
server = "Server"
sourceFile = "\\mydomain\NETLOGON\somepath\" & service & ".prf"

Set objShell = WScript.CreateObject("WScript.Shell")

'Get user profile, sAMAccountName
Set objEnv = objShell.Environment("PROCESS")
userProfile = objEnv("UserProfile")
if debugmode = 1 then wscript.echo "userProfile:" & vbcrlf & userProfile

sAMAccountName = objEnv("UserName")
if debugmode = 1 then wscript.echo "sAMAccountName:" & vbcrlf & sAMAccountName

targetFile = userProfile & "\" & sAMAccountName & "_" & server & "_" &
service & ".prf"
if debugmode = 1 then wscript.echo "targetFile:" & vbcrlf & targetFile

'PRF file; check existence
Set objFSO = CreateObject("Scripting.FileSystemObject")
if checkPrevious = 1 then
prfExists = objFSO.FileExists(targetFile)

If prfExists Then
if debugmode = 1 then wscript.echo "PRF file previously created and
executed" & vbcrlf & targetFile
wscript.quit
End If
end if

'get user password
password = inputbox("Please enter your PST password:",title,"")

'Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile (sourceFile, ForReading)

fileData = objTextfile.readall
fileData = replace(fileData,"Password=***DEFAULT_PASSWORD***" ,"DisplayName="
& password)

Set objTextFile = objFSO.OpenTextFile (targetFile, ForWriting, true)
objTextFile.Writeline fileData
objTextFile.close


'Execute configured PRF file
targetFile = chr(34) & targetFile & chr(34)
if debugmode = 1 then wscript.echo "Import targetFile:" & vbcrlf & targetFile
objShell.Run "outlook.exe /importprf " & targetFile

'Clear PRF file
fileData = "PRF executed. This is now a placeholder file."
Set objTextFile = objFSO.OpenTextFile (targetFile, ForWriting, true)
objTextFile.Writeline fileData
objTextFile.close

if debugmode = 1 then wscript.echo title & " - Complete!"
'End of Script

"Groupex1" wrote:

I tried this and it does work but with 50 users having their PSTs with
passwords, it's just not a solution. I need the PRF to map their current
PSTs and prompt them for password.

"Daines Lobo" wrote:

Why dont you try entering the password in the prf. In the "Password-" field for the personal folder, just try entering the password of the pst. And then go to the client, delete the registry key that has the first run value. After this try importing the prf using the importprf switch from the run command.

Also one importing thing here, if pst is stored on UNC, then that is actually not supported even by Microsoft. So it is recommended that the pst is on the local path.
I hope this will resolve your issue.
reply to this post with the result....

A Womand Told Me
http://www.awomantoldme.com

Ads