Exchange 2007: How to export mailbox with management shell?

February 1st, 2010

image After releasing Exchange Server Service Pack 1 (SP1) Microsoft added new functionality called Export-Mailbox cmdlet for Exchange Management Shell.

The Export-Mailbox cmdlet exports all message types, including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents. However, the Export-Mailbox cmdlet does not export rules.

To export data from a .pst file, you must run the Export-Mailbox cmdlet from a 32-bit computer that has the 32-bit version of the Exchange management tools and Outlook 2003 Service Pack 2 (SP2) or Outlook 2007 installed.

Well all prerequisites were in place; I opened the Exchange Management Shell and run the following command line:

[PS] C:\Documents and Settings\admin>Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst

Confirm
Are you sure you want to perform this action?
Exporting mailbox content from the mailbox ‘Gaag, van der Rob’ into .pst file ‘c:\gaagr.pst’. This operation may take a long time to
complete.
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
Export-Mailbox : Error was found for User1 (user1(at)networknet.nl) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error:
MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: -1056749164
At line:1 char:15
+ Export-Mailbox <<<<  -identity user1 -PSTFolderPath c:\user1.pst
    + CategoryInfo          : InvalidOperation: (0:Int32) [Export-Mailbox], RecipientTaskException
    + FullyQualifiedErrorId : DFCFF30D,Microsoft.Exchange.Management.RecipientTasks.ExportMailbox

The export failed. After reading some posts on Google I found the solution myself. I tried to export my own mailbox which worked fine so the problem has to be within the permissions set. To get full access run the Add-MailboxPermissions cmdlet.

Add-MailboxPermission -identity user1 -Accessrights FULLACCESS -User admin 
Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst 

With these steps I can develop a procedure to backup mailboxes when they are removed from the system.

Exchange 2007: unexpected error with management shell

February 1st, 2010

image  I received the following error message when opening and running a cmdlet with my Exchange Management Shell:

 

 

[PS] C:\Documents and Settings\admin>Export-Mailbox -identity user1 -PSTFolderPath c:\user1.pst
WARNING: An unexpected error has occurred and debug information is being generated: Unable to determine the installed file version
from the registry key ‘Software\Microsoft\Exchange\Setup’.

Export-Mailbox : Unable to determine the installed file version from the registry key ‘Software\Microsoft\Exchange\Setup’.
At line:1 char:15
+ Export-Mailbox <<<<  -identity user1 -PSTFolderPath c:\user1.pst
    + CategoryInfo          : NotSpecified: (:) [Export-Mailbox], TaskException
    + FullyQualifiedErrorId : Microsoft.Exchange.Configuration.Tasks.TaskException,Microsoft.Exchange.Management.RecipientTasks.ExportMailbox

Just looking on the error message it seems that something was missing in the Windows Registry. I opened Registry Editor and browsed to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange. The Setup key was missing. Exchange 2007 management tools were installed to another server than Exchange Server was installed. I logged on the Exchange 2007 server, opened Registry Editor and browsed to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange key.  The Setup folder was visible and I right-clicked on the Setup folder and exported the Setup branch.

I went back to my Exchange 2007 Management installed server and imported the reg file.

image

After importing the reg file my problem was solved and I had another challenge with Export-Mailbox cmdlet.

Windows Server 2008 R2 : enable wireless networking?

January 31st, 2010

imageWhen installing Windows Server 2008 R2 out of the box the configuration does not  support wireless networking. If  drivers are available Windows will find them with plug and play installation but not enable the functionality. Since Windows 7 and Windows Server 2008 R2 supports booting from a VHD file from local disks I am now building a  standard image which I will use for testing and development. The new VHD boot feature is amazing in helping IT professionals having multiple VHD files which they can boot from. Last night I needed to update my system with all latest patches and system settings therefore I needed to access the Internet without any wired connection.

Screen1

Not connected. No Connections are available after checking my adapters.

Microsoft released new tool named DISM.exe (Deployment Image Servicing and Management tool) which ships with Windows 7 and Windows Server 2008 R2.

DISM enumerates, installs, uninstalls, configures, and updates features and packages in Windows images. The commands that are available depend on the image being serviced and whether the image is offline or running.

Open elevated command prompt and query all available features “dism /online /get-features /format:table

image

WirelessNetworking is disabled. To enable this feature execute “dism /online /enable-feature:WirelessNetworking”

image

dism enables the WirelessNetworking feature and after I check my available wireless network connections the WIFI networks are not shows.

Screen4

PowerShell: How to delete a file based on a list of computers?

January 31st, 2010

image[1]The following PowerShell script recipe will help you delete a remote file based on a list of computers stored in a text file. New PowerShell function will be created during the session which will be piped from the text file.

 

 

 

Generate C:\Scripts\Active_Computers.txt with computer names.

[PowerShell]
function delete-remotefile {
    PROCESS {
                $file = "\\$_\c$\install.exe"
                if (test-path $file)
                {
                echo "$_ install.exe exists"
                Remove-Item $file -force
                echo "$_ install.exe file deleted"
                }
            }
}

Get-Content  C:\Scripts\Active_Computers.txt | delete-remotefile
[/PowerShell]

PowerShell: How to check list of computers for a specific remote file ?

January 31st, 2010

image The following PowerShell script recipe will help you check a remote file based on a list of computers stored in a text file. A new PowerShell function will be created during the session which will be piped from the text file.

In the following PowerShell example I will check if install.exe exists on the remote systems and echo the computername if the file is there.

 

Create new text file named C:\Scripts\Active_Computers.txt and populate the file with computer names.

[PowerShell]

function check-remotefile {

    PROCESS {

                $file = "\\$_\c$\install.exe"

                if (test-path $file)

                {

                echo "$_ file install.exe exists"

                }

            }

}

Get-Content  C:\Scripts\Active_Computers.txt | check-remotefile

[PowerShell]

PhotoShop: iPhone icon template (PSD)

January 23rd, 2010

Today I am releasing my first Photoshop template to the public and starting my series on web development and Photoshop. I am catching up with my Photoshop skills and experimenting how to use different techniques today seen on the web.

PhotoShop Apple iPhone icon

This template is ready for use for your iPhone app or integrate the graphic on your website.

Click here to dowload the PhotoShop Apple iPhone Icon template.