×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CONFIGURE OUTLOOK PROFILE VBSCRIPT

CONFIGURE OUTLOOK PROFILE VBSCRIPT

CONFIGURE OUTLOOK PROFILE VBSCRIPT

(OP)
Hi forum. Anybody here maybe knows, if is possible to configure outlook profile with VB logon script???? Every help is wellcome. Thx

Jure

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

What version of Outlook? I have a script that creates profiles on Outlook 2000 - 2003.

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

(OP)
Thx for reply SIPIN. I use Outlook 2000.

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

I am also interested in this script.

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

Ha! My manager just asked that we add this to our script too.  Could you forward the script to me as well.

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

You gus should download a copy of the ORK (Office Resource Kit.  You can push down entirely configured versions of Outlook and your user will just get prompted for their initials on first load.

Please refer to my FAQ for details.  FAQ96-4996

I hope you find this post helpful.  Please let me know if it was.

Regards,

Mark

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

Here is the code. Sorry it took so long, been a little busy lately. Just follow the instructions and download the required files in files.zip at http://www.sharemation.com/xythoswfs/webui?action=... use login sipin password 123456

-Sip

'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.1
'
' NAME:
'
' AUTHOR: Sip
' DATE  : 8/1/2004
'
' COMMENT: Creates user's Outlook profile. The script creates a PRF directory on the user's home directory then copies %USERNAME%.prf within the PRF directory.  
'           Must have a source PRF directory and target user's home directory. Create a directory named "PRF" and put it on a share, copy the two .prf files and newprof.exe to this directory.
'          Open the .prf files in Notepad and edit New.prf "[ServiceEGS]&[Service1] HomeServer=NAMEOFMAILSERVER" Old.prf "[Service2] HomeServer=NAMEOFMAILSERVER.
'          If you have Outlook 2000 clients, copy cpau.exe and Outlook2000Reg.vbs to a share on your server. This will be needed to add registry entries.
'          The user's .prf file will be used to create their initial profile and to hold their Outlook settings. With outlook.exe you can export settings to the .prf then import into Outlook.
'          Tested on Windows 2000 and XP machines running Outlook 2000 - 2003.
'==========================================================================
'On Error Resume Next
'Initialize variables
Set oNet           =  WScript.CreateObject("WScript.Network")
Set WSHFileSystem  =  WScript.CreateObject("Scripting.FileSystemObject")
Set WSHShell       =  WScript.CreateObject("WScript.Shell")
strUserDomain      =  oNet.UserDomain
strUserName        =  oNet.UserName
HomeDrive            =  "U:\"                                  ' Specify the user's home directory drive.
PRFpath            =  "\\SERVER\Share01\PRF"                 ' Specify the path to the .prf template.
UserHome           =  "\\SERVER\Users\" & strUserName         ' Specify the user's home directory.
UserPRF            =  UserHome & "\PRF\"                     ' Specify the path where the user's .prf will reside.
NewPRF             =  "New.prf"                                 ' Name of the Outlook 2003/XP .prf template.
OldPRF               =  "Old.prf"                                 ' Name of the Outlook 2000 template.
Path               =  UserPRF & strUserName & ".prf"         ' Changes copied .prf file to user's %USERNAME%.
WSHInstall            =  "\\SERVER\Installs"                     ' Specify name of directory that holds objects.

AddReg           ' Adds registry entries for Outlook 2000.
OutlookProfile   ' Creates PRF\%USERNAME% on the user's home directory. Creates Outlook profile.

Sub OutlookProfile()
On Error Resume Next
    If Outlookver = "Outlook 2003" Then
       arr = WSHShell.RegRead("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\First-Run")
        If arr = True Then
            ElseIf Err.Number <> 0 Then
            WSHShell.RegWrite "HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\"
            If (WSHFileSystem.FileExists(PRFpath & "\" & NewPRF)) Then
            WSHFileSystem.CreateFolder(UserHome & "\PRF")  
               WSHFileSystem.CopyFile PRFpath & "\" & NewPRF, Path
               'WScript.Echo "Downloading Outlook Profile.."
            WSHShell.RegWrite "HKCU\Software\Microsoft\Office\11.0\Outlook\Setup\" & "ImportPRF", Path , "REG_SZ"
            'WScript.Echo "Setting Outlook Profile.."
            End If
         End If
     'End If
 Else
      If Outlookver = "Outlook XP" Then
         arr = WSHShell.RegRead("HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\First-Run")
         If arr = True Then
            ElseIf Err.Number <> 0 Then
             WSHShell.RegWrite "HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\"
            If (WSHFileSystem.FileExists(PRFpath & "\" & NewPRF)) Then
            WSHFileSystem.CreateFolder(UserHome & "\PRF")  
               WSHFileSystem.CopyFile PRFpath & "\" & NewPRF, Path
               'WScript.Echo "Downloading Outlook Profile.."
            WSHShell.RegWrite "HKCU\Software\Microsoft\Office\10.0\Outlook\Setup\" & "ImportPRF", Path , "REG_SZ"
            'WScript.Echo "Setting Outlook Profile.."
            End If
         End If
     'End If
Else
    If Outlookver = "Outlook 2000" Then
       arr = WSHShell.RegRead("HKCU\Software\Microsoft\Office\9.0\Outlook\Setup\First-Run")
        If arr = True Then
            ElseIf Err.Number <> 0 Then
             If (WSHFileSystem.FileExists(PRFpath & "\" & OldPRF)) Then
            WSHFileSystem.CreateFolder(UserHome & "\PRF")  
               WSHFileSystem.CopyFile PRFpath & "\" & OldPRF, Path
               'WScript.Echo "Downloading Outlook Profile.."
            WSHShell.Run PRFpath & "\NEWPROF.exe -p " & Path,1,True
            'WScript.Echo "Setting Outlook Profile.."
            End If
         End If
' Else
'     If Err.Number = 0 Then        
'      WScript.Echo "Profile already exists."
      End If
    End If
  End If
End Sub
        
Function Outlookver()
If DetermineObject <> "" Then
  Dim X
  Set X = CreateObject(DetermineObject)
  If Len(X.version) = 11 Then
    Select Case Left(X.version,2)
       Case "11"
       Outlookver = "Outlook 2003"
       Case "10"
       Outlookver = "Outlook XP"  
    End Select
  ElseIf Len(X.version) = 10 Then
    Select Case Left(X.version,1)
       Case "9"
       Outlookver = "Outlook 2000"
    End Select
  Set X = Nothing
Else OutlookVer = "Unknown"
'       End If
'     End If
   End If
End If
End Function

Function DetermineObject()
  On Error Resume Next
  Dim NEW_OBJ: Set NEW_OBJ = CreateObject("Outlook.Application.11")
  Dim OLD_OBJ: Set OLD_OBJ = CreateObject("Outlook.Application")
  Dim OLDER_OBJ: Set OLDER_OBJ = CreateObject("Outlook.Application.9")
  If IsObject(NEW_OBJ) Then
    DetermineObject = "Outlook.Application.11"
  ElseIf IsObject(OLD_OBJ) Then
    DetermineObject = "Outlook.Application"
  ElseIf IsObject(OLDER_OBJ) Then
    DetermineObject = "Outlook.Application.9"
  Else
    DetermineObject = ""
  End If
End Function


RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

Nice script SIPIN :)

However, it crashes on line 33: AddReg

RE: CONFIGURE OUTLOOK PROFILE VBSCRIPT

thats cause there is no AddReg sub/function

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close