Feb 28

How to Make Fedora 18 a PS3 Media Server

PS3 Media Server is a DLNA-compliant UPnP Media server which supports Playstation 3 and any other DLNA compliant device.  It allows you to stream video, music, images, etc to your DLNA device even if it does not support the codec the media is encoded in.  For a complete list of supported devices please visit http://www.ps3mediaserver.org/about/.

Install RPM Fusion

sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-branched.noarch.rpm

 

Install Software Dependencies

sudo yum -y install mencoder ffmpeg mplayer freeglut java wget

 

Install libzen and libmediainfo (Optional but recommended)

As of this writing, the current version of libzen is v0.4.28 which the below command references. You can check for updates by going to http://mediainfo.sourceforge.net/en/Download/Fedora and modifying the link below accordingly.

sudo yum -y install http://downloads.sourceforge.net/zenlib/libzen0-0.4.28-1.x86_64.Fedora_18.rpm

 

As of this writing, the current version of libmediainfo is v0.7.62 which the below command references. You can check for update by going to http://mediainfo.sourceforge.net/en/Download/Fedora and modifying the command below accordingly.

sudo yum -y install http://mediaarea.net/download/binary/libmediainfo0/0.7.62/libmediainfo0-0.7.62-1.x86_64.Fedora_18.rpm

 

 

Add Firewall Exceptions for PS3 Media Server

sudo firewall-cmd --permanent --add-port=5001/tcp
sudo firewall-cmd --permanent --add-port=5353/udp
sudo firewall-cmd --reload

 

 

Install PS3 Media Server, Make It Executable, and Start Media Server

As of this writing, the current version of PS3 Media Server is 1.72.0, which is used in the below command. You can check for an update by going to http://code.google.com/p/ps3mediaserver/downloads/list and modifying command below accordingly.

wget http://ps3mediaserver.googlecode.com/files/pms-generic-linux-unix-1.72.0.tgz
tar -zxvf pms-generic-linux-unix-1.72.0.tgz
chmod +x pms-1.72.0/PMS.sh
pms-1.72.0/PMS.sh

 

Configure Navigation/Share Settings

By default, PS3 Media Server allows browsing All Drives on your system. For security reasons, you’ll want to modify the Share settings to only access specific folders such as music, pictures, and videos using the following steps:

  1. Click the Navigation/Share Settings Tab
  2. Under the Shared Folders section, click the Add button
    1. Select the folder you want to be accessible (ex: /home/<username>/music/)
  3. Repeat the previous step for each folder you want to be available
  4. Click the Save button
  5. Click the Restart Server button

PMS Navigation/Share Settings

 

Feb 26

How to Remotely Access Linux From Windows

There are many ways to remotely access Linux including VNC, SSH, FreeNX, NXFree, Hamachi, Teamviewer, and the list goes on.  When it comes to remote access a few questions come to mind…  Is it secure, is it GUI or Command Line, how’s the performance, what extra software is required, etc.  If you are connecting to your Fedora 18 install from Windows there’s a great solution called xRDP.  xRDP uses the Windows Remote Desktop protocol to present an X window’s desktop to the user.  The Windows Remote Desktop offers a secure connection to your Linux box, similar to VNC over SSH.  In addition, it does not require any additional software on your Windows machine since the Remote Desktop Client is built in.  If you are running Linux, you can remote into the server using RDesktop (Included in Fedora 18).

Install xRDP

sudo yum install xrdp

Start the xRDP Service and Set It to Start at Boot

systemctl start xrdp.service
systemctl enable xrdp.service

Add RDP Exception to the Firewall

firewall-cmd --add-port=3389/tcp
firewall-cmd --permanent --add-port=3389/tcp

Open the Windows RDP Client and Connect to Linux

WindowsRDPClient xRDPLogin

Customize Desktop Environment for xRDP Session

If you do not want to use the default desktop environment, you can customize it by creating a .Xclients file (X is capital!!!) in your home directory to launch the desktop environment you want and making it executable.  In order to do this, open a terminal and run one of the following commands

Gnome 3

sudo echo "gnome-session" > ~/.Xclients
sudo chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

Gnome Fallback

sudo echo "gnome-fallback" > ~/.Xclients
sudo chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

KDE

sudo echo "startkde" > ~/.Xclients
sudo chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

MATE

sudo echo "mate-session" > ~/.Xclients
sudo chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

Cinnamon

sudo echo "cinnamon" > ~/.Xclients
sudo chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

Xfce4

sudo echo "startxfce4" > ~/.Xclients
sudo chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

 

Feb 26

How to Install Mate, Cinnamon, KDE Plasma, and Xfce on Fedora 18

The Fedora 18 distribution ships using Gnome3 in most circumstances as the default desktop environment. There has been a lot of controversy about the direction Gnome3 has gone, which sparked many spin-off projects. If you are not a fan of Gnome3 or are just looking to try other desktop environments for Fedora, here are the directions you’ll need.  Please note, you need to be root to run the following commands.  You may switch to the root account in the terminal by issuing the ‘su’ command or by using ‘sudo’ in front of the commands below if your account is part of the administrators group.

 

Make Sure Fedora is Up to Date

Open a terminal and run the following command to update Fedora.

yum update

 

Install the MATE Desktop Environment

http://wiki.mate-desktop.org/download

Open a terminal and run the following command to install the MATE Desktop Environment

yum groupinstall "MATE Desktop"

Install the Cinnamon Desktop Environment

http://docs.fedoraproject.org/en-US/Fedora/18/html/Release_Notes/sect-Release_Notes-Changes_for_Desktop.html

Open a terminal and run the following command to install the Cinnamon Desktop Environment

yum groupinstall "Cinnamon Desktop"

Install the KDE Plasma Workspace

http://fedoraproject.org/wiki/KDE

Open a terminal and run the following command to install the KDE Plasma Workspace

yum install @kde-desktop

Install the Xfce Desktop Environment

http://fedoraproject.org/wiki/Xfce

Open a terminal and run the following command to install the Xfce Desktop Environment

yum groupinstall XFCE

 

Feb 09

ConvertOutlookContactsToAD.vbs

'=========================================================================
' ConvertOutlookContactsToAD.vbs
' VERSION: 1.0
' AUTHOR: Brian Steinmeyer
' EMAIL: sigkill@sigkillit.com
' WEB: http://sigkillit.com
' DATE: 2/9/2013
' REQUIREMENTS: Requires Exchange Tools or CDOEXM.DLL on the computer running
' the script to create Email enabled contacts. The script also uses OLEDB,
' which requires running it with %systemroot%\SysWow64\wscript.exe,
' %systemroot%\SysWow64\cscript.exe, or a 64-bit OLEDB Provider.
' COMMENTS: The script is designed to take an Outlook CSV(DOS) Exported list of
' contacts which is used to create AD contacts. However, not all attributes directly
' translate or have an equivelent. For example, AD only has attributes for a single
' address where Outlook contacts can have business, home, and other addresses. The
' strUserType variable was created to allow you to pick 1 of those 3 options to use
' on the import.
' To use the script export your Outlook contacts to a CSV(DOS) file. Then set the
' variables for the log file (Default is in the same directory as the script), the
' DN of the container you want to create the AD Contacts in, the location of the
' Outlook Exported Contacts CSV file, and the UserType(Business, Home, Other)
' EXAMPLE: Create Contacts with CSV file in the same folder as the script
'          Dim strLogFile: strLogFile = Replace(WScript.ScriptName,".vbs",".txt")
'          Dim contactsDN: contactsDN = "OU=Contacts, DC=domain, DC=com"
'          Dim contactsExport: contactsExport = "export.csv"
'          Dim strUserType: strUserType = "Business"
' EXAMPLE: Create Contacts Using the Home Address in the CSV
'          Dim strLogFile: strLogFile = Replace(WScript.ScriptName,".vbs",".txt")
'          Dim contactsDN: contactsDN = "OU=Contacts, DC=domain, DC=com"
'          Dim contactsExport: contactsExport = "export.csv"
'          Dim strUserType: strUserType = "Home"
' EXAMPLE: Create Contacts with CSV file in a different folder as the script
'          Dim strLogFile: strLogFile = Replace(WScript.ScriptName,".vbs",".txt")
'          Dim contactsDN: contactsDN = "OU=Contacts, DC=domain, DC=com"
'          Dim contactsExport: contactsExport = "C:\scripts\export.csv"
'          Dim strUserType: strUserType = "Business"
'=========================================================================
Option Explicit
' ------ START CONFIGURATION ------
Dim strLogFile: strLogFile = Replace(WScript.ScriptName,".vbs",".txt")
Dim contactsDN: contactsDN = "OU=Contacts, DC=domain, DC=com"
Dim contactsExport: contactsExport = "export.csv"
Dim strUserType: strUserType = "Business" 'Business, Home, Other
' ------ END CONFIGURATION ------

Call Logger(strLogFile, "USER:GENERAL, EMAIL, ORGANIZATION, ADDRESS, TELEPHONE", True)
Call CreateContacts(contactsExport, contactsDN, strUserType, strLogFile)
Wscript.Echo "Finished"

Private Sub CreateContacts(strContactsFile, strContactsDN, UserType, strLogFile)

    On Error Resume Next  'Start Error Handling

    'Ensure DN not ADS Path
    strContactsDN = Replace(strContactsDN,"LDAP://","",1,1,1)  

    'Grab Contacts With OLEDB - If Using a 64-bit OS you Must Use
    ' - C:\Windows\SysWow64\wscript.exe OR C:\Windows\SysWow64\cscript.exe
    ' - Alternatively, use a 64-bit OLEDB Provider (http://www.microsoft.com/en-us/download/details.aspx?id=20065)
    Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
    Dim objFile: Set objFile = objFSO.GetFile(strContactsFile)
    Const adOpenStatic = 3
    Const adLockOptimistic = 3
    Const adCmdText = &H0001
    Dim objConnection: Set objConnection = CreateObject("ADODB.Connection")
    Dim objRecordSet: Set objRecordSet = CreateObject("ADODB.Recordset")
    objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=" & objFile.ParentFolder & "\;" & _
        "Extended Properties=""text;HDR=YES;FMT=Delimited"""
    objRecordset.Open "SELECT * FROM [" & objFile.Name & "]", objConnection, adOpenStatic, adLockOptimistic, adCmdText
    If Err.Number <> 0 Then
        Err.Clear
        Call Logger(strLogFile, "Error Contacts File Is Already Opened, Quitting Script!", False)
    End If

    'Connect to AD and Get Contacts Container
    Const ADS_SCOPE_SUBTREE = 2
    Dim objConnection2: Set objConnection2 = CreateObject("ADODB.Connection")
    Dim objCommand: Set objCommand = CreateObject("ADODB.Command")
    objConnection2.Provider = "ADsDSOObject"
    objConnection2.Open "Active Directory Provider"
    Set objCommand.ActiveConnection = objConnection2
    objCommand.Properties("Page Size") = 1000   'Override the Return 1000 Results Default      
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE    'Include Sub OU's
    objCommand.CommandText = "SELECT ADsPath FROM 'LDAP://" & strContactsDN & "'"
    Dim objRecordset2: Set objRecordSet2 = objCommand.Execute
    If Not objRecordSet2.RecordCount > 0 Then
        Call Logger(strLogFile, "Error Contacts Container Doesn't Exist, Quitting Script!", False)
        Exit Sub
    End If
    Dim objContainer: Set objContainer = GetObject(objRecordSet2.Fields("AdsPath").Value)
    Dim strResult
    Dim blnAttributeFound
    Dim objContact, cFName, cLName, cInitials, cOffice, cWebpage
    Dim cEmail, cEmailAlias
    Dim cJobTitle, cDepartment, cCompany
    Dim cStreet, cCity, cState, cZip, cCountry, cPOBox
    Dim cHomePhone, cOtherHomePhone, cPager, cMobile, cFax, cOtherFax, cIPPhone, cOtherIPPhone, cTelephone, cOtherTelephone, cNotes
    Do Until objRecordset.EOF
        'Set Contact CN
        strResult = objRecordset.Fields.Item("First Name") & " " & objRecordset.Fields.Item("Last Name") & ":"
        Set objContact = objContainer.Create("Contact","CN=" & objRecordset.Fields.Item("First Name") & " " & objRecordset.Fields.Item("Last Name"))

        'General Attributes (Telephone/Other Telephone Under Telephones Attributes and E-mail Under Email Attributes
        If Not IsNull(objRecordset.Fields.Item("First Name")) AND Not IsNull(objRecordset.Fields.Item("Last Name")) Then
            cFName = objRecordset.Fields.Item("First Name")
            cLName = objRecordset.Fields.Item("Last Name")
            objContact.Put "givenName", cFName
            objContact.Put "SN", cLName
            objContact.Put "displayname", cFName & " " & cLName
        Elseif Not IsNull(objRecordset.Fields.Item("First Name")) AND IsNull(objRecordset.Fields.Item("Last Name")) Then
            cFName = objRecordset.Fields.Item("First Name")
            objContact.Put "givenName", cFName
            objContact.Put "displayname", cFName
        Elseif IsNull(objRecordset.Fields.Item("First Name")) AND Not IsNull(objRecordset.Fields.Item("Last Name")) Then
            cLName = objRecordset.Fields.Item("Last Name")
            objContact.Put "SN", cLName
            objContact.Put "displayname", cLName           
        End If
        If Not IsNull(objRecordset.Fields.Item("Initials")) Then
            cInitials = objRecordset.Fields.Item("Initials")
            objContact.Put "initials", cInitials
        End If
        If Not IsNull(objRecordset.Fields.Item("Office Location")) Then
            cOffice = objRecordset.Fields.Item("Office Location")
            objContact.Put "physicalDeliveryOfficeName", cOffice
        End If
        If Not IsNull(objRecordset.Fields.Item("Web Page")) Then
            cWebpage = objRecordset.Fields.Item("Web Page")
            objContact.Put "wWWHomePage", cWebpage
        End If
        objContact.SetInfo
        If Err.Number <> 0 Then
            Err.Clear
            strResult = strResult & "ERROR,ERROR,ERROR,ERROR,ERROR"
        Else
            strResult = strResult & "SUCCESS,"

            'Email Attributes (Assumes First Email)
            blnAttributeFound = False
            If Not IsNull(objRecordset.Fields.Item("E-mail Address")) Then
                blnAttributeFound = True
                cEmail = objRecordset.Fields.Item("E-mail Address")
                objContact.Put "Mail", cEmail
                objContact.MailEnable cEmail
            End If
            If Not IsNull(objRecordset.Fields.Item("E-mail Display Name")) Then
                blnAttributeFound = True
                cEmailAlias = objRecordset.Fields.Item("E-mail Display Name")
                objContact.Put "mailNickname", cEmailAlias
                objContact.MailEnable cEmail
            End If
            If blnAttributeFound = True Then
                objContact.SetInfo
            End If
            If Err.Number <> 0 Then
                Err.Clear
                strResult = strResult & "ERROR,"
            Else
                strResult = strResult & "SUCCESS,"
            End If

            'Organization Attributes
            blnAttributeFound = False
            If Not IsNull(objRecordset.Fields.Item("Job Title")) Then
                blnAttributeFound = True
                cJobTitle = objRecordset.Fields.Item("Job Title")
                objContact.Put "title", cJobTitle
            End If
            If Not IsNull(objRecordset.Fields.Item("Department")) Then
                blnAttributeFound = True
                cDepartment = objRecordset.Fields.Item("Department")
                objContact.Put "department", cDepartment
            End If
            If Not IsNull(objRecordset.Fields.Item("Company")) Then
                blnAttributeFound = True
                cCompany = objRecordset.Fields.Item("Company")
                objContact.Put "company", cCompany
            End If
            If blnAttributeFound = True Then
                objContact.SetInfo
            End If
            If Err.Number <> 0 Then
                Err.Clear
                strResult = strResult & "ERROR,"
            Else
                strResult = strResult & "SUCCESS,"
            End If

            'Address Attributes (Add Variable to choose business, home, or other)
            blnAttributeFound = False
            Select Case UCase(UserType)
            Case "BUSINESS"
                If Not IsNull(objRecordset.Fields.Item("Business Street")) Then
                    blnAttributeFound = True
                    cStreet = objRecordset.Fields.Item("Business Street")
                    If Not IsNull(objRecordset.Fields.Item("Business Street 2")) Then
                        cStreet = cStreet & vbCrLf & objRecordset.Fields.Item("Business Street 2")
                    End If
                    If Not IsNull(objRecordset.Fields.Item("Business Street 3")) Then
                        cStreet = cStreet & vbCrLf & objRecordset.Fields.Item("Business Street 3")
                    End If
                    objContact.Put "streetAddress", cStreet
                End If
                If Not IsNull(objRecordset.Fields.Item("Business City")) Then
                    blnAttributeFound = True
                    cCity = objRecordset.Fields.Item("Business City")
                    objContact.Put "l", cCity
                End If
                If Not IsNull(objRecordset.Fields.Item("Business State")) Then
                    blnAttributeFound = True
                    cState = objRecordset.Fields.Item("Business State")
                    objContact.Put "st", cState
                End If
                If Not IsNull(objRecordset.Fields.Item("Business Postal Code")) Then
                    blnAttributeFound = True
                    cZip = objRecordset.Fields.Item("Business Postal Code")
                    objContact.Put "postalCode", cZip
                End If
                If Not IsNull(objRecordset.Fields.Item("Business Country/Region")) Then
                    blnAttributeFound = True
                    cCountry = objRecordset.Fields.Item("Business Country/Region")
                    objContact.Put "co", cCountry  'Note: use co to choose Country Name in ISO3166
                End If
                If Not IsNull(objRecordset.Fields.Item("Business Address PO Box")) Then
                    blnAttributeFound = True
                    cPOBox = objRecordset.Fields.Item("Business Address PO Box")
                    objContact.Put "postOfficeBox", cPOBox
                End If
            Case "HOME"
                If Not IsNull(objRecordset.Fields.Item("Home Street")) Then
                    blnAttributeFound = True
                    cStreet = objRecordset.Fields.Item("Home Street")
                    If Not IsNull(objRecordset.Fields.Item("Home Street 2")) Then
                        cStreet = cStreet & vbCrLf & objRecordset.Fields.Item("Home Street 2")
                    End If
                    If Not IsNull(objRecordset.Fields.Item("Home Street 3")) Then
                        cStreet = cStreet & vbCrLf & objRecordset.Fields.Item("Home Street 3")
                    End If
                    objContact.Put "streetAddress", cStreet
                End If
                If Not IsNull(objRecordset.Fields.Item("Home City")) Then
                    blnAttributeFound = True
                    cCity = objRecordset.Fields.Item("Home City")
                    objContact.Put "l", cCity
                End If
                If Not IsNull(objRecordset.Fields.Item("Home State")) Then
                    blnAttributeFound = True
                    cState = objRecordset.Fields.Item("Home State")
                    objContact.Put "st", cState
                End If
                If Not IsNull(objRecordset.Fields.Item("Home Postal Code")) Then
                    blnAttributeFound = True
                    cZip = objRecordset.Fields.Item("Home Postal Code")
                    objContact.Put "postalCode", cZip
                End If
                If Not IsNull(objRecordset.Fields.Item("Home Country/Region")) Then
                    blnAttributeFound = True
                    cCountry = objRecordset.Fields.Item("Home Country/Region")
                    objContact.Put "co", cCountry  'Note: use co to choose Country Name in ISO3166
                End If
                If Not IsNull(objRecordset.Fields.Item("Home Address PO Box")) Then
                    blnAttributeFound = True
                    cPOBox = objRecordset.Fields.Item("Home Address PO Box")
                    objContact.Put "postOfficeBox", cPOBox
                End If
            Case "OTHER"
                If Not IsNull(objRecordset.Fields.Item("Other Street")) Then
                    blnAttributeFound = True
                    cStreet = objRecordset.Fields.Item("Other Street")
                    If Not IsNull(objRecordset.Fields.Item("Other Street 2")) Then
                        cStreet = cStreet & vbCrLf & objRecordset.Fields.Item("Other Street 2")
                    End If
                    If Not IsNull(objRecordset.Fields.Item("Other Street 3")) Then
                        cStreet = cStreet & vbCrLf & objRecordset.Fields.Item("Other Street 3")
                    End If
                    objContact.Put "streetAddress", cStreet
                End If
                If Not IsNull(objRecordset.Fields.Item("Other City")) Then
                    blnAttributeFound = True
                    cCity = objRecordset.Fields.Item("Other City")
                    objContact.Put "l", cCity
                End If
                If Not IsNull(objRecordset.Fields.Item("Other State")) Then
                    blnAttributeFound = True
                    cState = objRecordset.Fields.Item("Other State")
                    objContact.Put "st", cState
                End If
                If Not IsNull(objRecordset.Fields.Item("Other Postal Code")) Then
                    blnAttributeFound = True
                    cZip = objRecordset.Fields.Item("Other Postal Code")
                    objContact.Put "postalCode", cZip
                End If
                If Not IsNull(objRecordset.Fields.Item("Other Country/Region")) Then
                    blnAttributeFound = True
                    cCountry = objRecordset.Fields.Item("Other Country/Region")
                    objContact.Put "co", cCountry  'Note: use co to choose Country Name in ISO3166
                End If
                If Not IsNull(objRecordset.Fields.Item("Other Address PO Box")) Then
                    blnAttributeFound = True
                    cPOBox = objRecordset.Fields.Item("Other Address PO Box")
                    objContact.Put "postOfficeBox", cPOBox
                End If
            End Select
            If blnAttributeFound = True Then
                objContact.SetInfo
            End If
            If Err.Number <> 0 Then
                Err.Clear
                strResult = strResult & "ERROR,"
            Else
                strResult = strResult & "SUCCESS,"
            End If

            'Telephone Attributes (Add Variable to choose business, home or other)
            blnAttributeFound = False
            If Not IsNull(objRecordset.Fields.Item("Home Phone")) Then
                blnAttributeFound = True
                cHomePhone = objRecordset.Fields.Item("Home Phone")
                objContact.Put "homePhone", cHomePhone
            End If
            If Not IsNull(objRecordset.Fields.Item("Home Phone 2")) Then
                blnAttributeFound = True
                cOtherHomePhone = objRecordset.Fields.Item("Home Phone 2")
                objContact.PutEx 3, "otherHomePhone", Array(cOtherHomePhone)
            End If
            If Not IsNull(objRecordset.Fields.Item("Pager")) Then
                blnAttributeFound = True
                cPager = objRecordset.Fields.Item("Pager")
                objContact.Put "pager", cPager
            End If
            If Not IsNull(objRecordset.Fields.Item("Mobile Phone")) Then
                blnAttributeFound = True
                cMobile = objRecordset.Fields.Item("Mobile Phone")
                objContact.Put "mobile", cMobile
            End If
            If Not IsNull(objRecordset.Fields.Item("Business Fax")) Then
                blnAttributeFound = True
                cFax = objRecordset.Fields.Item("Business Fax")
                objContact.Put "facsimileTelephoneNumber", cFax
            End If
            If Not IsNull(objRecordset.Fields.Item("Home Fax")) Then
                blnAttributeFound = True
                cOtherFax = objRecordset.Fields.Item("Home Fax")
                objContact.PutEx 3, "otherFacsimileTelephoneNumber", Array(cOtherFax)
            End If
            If Not IsNull(objRecordset.Fields.Item("Other Fax")) Then
                blnAttributeFound = True
                cOtherFax = objRecordset.Fields.Item("Other Fax")
                objContact.PutEx 3, "otherFacsimileTelephoneNumber", Array(cOtherFax)
            End If
            If Not IsNull(objRecordset.Fields.Item("Business Phone")) Then
                blnAttributeFound = True
                cIPPhone = objRecordset.Fields.Item("Business Phone")
                objContact.Put "ipPhone", cIPPhone
            End If
            If Not IsNull(objRecordset.Fields.Item("Business Phone 2")) Then
                blnAttributeFound = True
                cOtherIPPhone = objRecordset.Fields.Item("Business Phone 2")
                objContact.PutEx 3, "otherIpPhone", Array(cOtherIPPhone)
            End If
            If Not IsNull(objRecordset.Fields.Item("Company Main Phone")) Then
                blnAttributeFound = True
                cOtherIPPhone = objRecordset.Fields.Item("Company Main Phone")
                objContact.PutEx 3, "otherIpPhone", Array(cOtherIPPhone)
            End If
            If Not IsNull(objRecordset.Fields.Item("Primary Phone")) Then
                blnAttributeFound = True
                cTelephone = objRecordset.Fields.Item("Primary Phone")
                objContact.Put "telephoneNumber", cTelephone
            End If
            If Not IsNull(objRecordset.Fields.Item("Other Phone")) Then
                blnAttributeFound = True
                cOtherTelephone = objRecordset.Fields.Item("Other Phone")
                objContact.Put "otherTelephone", cOtherTelephone
            End If
            If Not IsNull(objRecordset.Fields.Item("Notes")) Then
                blnAttributeFound = True
                cNotes = objRecordset.Fields.Item("Notes")
                objContact.Put "info", cNotes
            End If
            If blnAttributeFound = True Then
                objContact.SetInfo
            End If
            If Err.Number <> 0 Then
                Err.Clear
                strResult = strResult & "ERROR"
            Else
                strResult = strResult & "SUCCESS"
            End If
        End If

        'Log Results
        Call Logger(strLogFile, strResult, False)      
        objRecordset.MoveNext
    Loop

    objRecordset.Close
    objRecordset2.Close

    On Error Goto 0  'End Error Handling

End Sub

Private Sub Logger(fileName, logMessage, blnNewLog)

    On Error Resume Next

    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
    Dim scriptPath: scriptPath = Left(WScript.ScriptFullName,InstrRev(WScript.ScriptFullName,"\"))
    Dim logName
    If InStr(1,fileName,"\",1) > 0 Then
        logName = fileName
        If objFSO.DriveExists(objFSO.GetDriveName(logName)) Then
            If StrComp(objFSO.GetExtensionName(logName), "", 1) = 0 Then
                If Not objFSO.FolderExists(logName) Then
                    If objFSO.FolderExists(objFSO.GetParentFolderName(logName)) Then
                        objFSO.CreateFolder logName 'Create Folder In Current Path
                        Exit Sub
                    Else
                        Call Logger(objFSO.GetParentFolderName(logName), logMessage, blnNewLog) 'Recurse Creating Parent Folder
                        Call Logger(logName, logMessage, blnNewLog) 'Recurse Creating Current Folder
                        Exit Sub
                    End If
                End If
            Else
                If Not objFSO.FileExists(logName) Then
                    If Not objFSO.FolderExists(objFSO.GetParentFolderName(logName)) Then
                        Call Logger(objFSO.GetParentFolderName(logName), logMessage, blnNewLog)  'Recurse Creating Parent Folder
                        Call Logger(logName, logMessage, blnNewLog)  'Recurse Creating Current Folder
                    End If
                End If
            End If
        End If
    Else
        logName = scriptPath & fileName
    End If
    Dim logFile
    If blnNewLog = True Then
        Set logFile = objFSO.CreateTextFile(logName, True)
    Else
        If objFSO.FileExists(logName) Then
            Set logFile = objFSO.OpenTextFile(logName, ForAppending, True)
        Else
            Set logFile = objFSO.CreateTextFile(logName, True)
        End If
    End If
    logFile.WriteLine logMessage
    logFile.Close
    Set objFSO = Nothing

    On Error Goto 0

End Sub

 

Feb 07

Outlook unable to open your default e-mail folders

Error Messages

  • unable to open your default e-mail folders
  • Cannot open the Outlook window. The server is not available.

Resolution 1

Outlook was installed with compatibility mode.

  1. Locate your outlook.exe,
    1. Typically in C:\Program Files (x86)\Microsoft Office\Office14\
      1. (Note: 14 is for office 2010, yours may vary depending on your version of Outlook).
  2. Right-click the OUTLOOK.EXE, and select properties.
  3. On the Compatibility tab, uncheck all of the settings as shown belowOutlook Compatibility Tab Everything Unchecked

 

Resolution 2

Use the /resetnavpane when opening Outlook.

  1. Click Start and enter cmd in the search/run menu to open a command prompt
  2. In the command prompt, run the following command
    1. (Note: 14 is for office 2010, yours may vary depending on your version of Outlook)
C:\Program Files (x86)\Microsoft Office\Office14\outlook.exe /resetnavpane