How to import msg files into Outlook with Powershell

Hello,
I want to import contact msg files on the file system into Outllok.
Before I want to delete all contacts in this contact folder.
Can you show me how please.
Frank

# 1 - try to not create lots of interim items as it make it harder to shutdown Outlook.
# 2 - To delete all items in a folder:
      $namespace.GetDefaultFolder(10).Items |%{$_.delete()}
The following code of your makes no sense.  What are you trying to do?
$SourceFiles = Get-ChildItem -path "D:\ccc\*" -include *.msg      #-recurse
foreach ($_ in $SourceFiles)
        $x ++
        $MailItem = $_
        $olMailItem = $NameSpace.OpenSharedItem($MailItem)
  [void]$olMailItem.Move($objContactFolder)
This is a better construct:
Get-ChildItem -path "D:\ccc\*" -include *.msg |
     ForEach-Object{
          $nameSpace.OpenSharedItem($_).Move($namespace.GetDefaultFolder(10))
But I don't think it is correct.  What are you trying to do?
¯\_(ツ)_/¯

Similar Messages

  • How to import .iaf files into Outlook 2011 for mac?

    I exported emails from Outlook Express (PC) to .iaf files years ago and now need to access them on a mac. I have downloaded Office for mac 2011 but can't work out how to import them into Outlook 2011.
    Can it be done? Any suggestions would be hugely helpful.
    Thanks.

    Hi,
    We can import .iaf files in Outlook 2010 using the following method:
    Start Outlook 2010.
    On the File menu, click Import and Export.
    Click the Advanced tab, and then click Export.
    Click Import Internet Mail Account Settings, and then click
    Next.
    Follow the Internet Connection Wizard to complete the import process.
    But, I don't know if we can do this in Outlook for Mac 2011. Since this forum is for general questions and feedback related to Outlook for Windows, it's better to post Mac related issue to the forum for Mac:
    http://answers.microsoft.com/en-us/mac/forum/macoutlook?tab=Threads
    The reason why we recommend posting appropriately is
    you
    will
    get the most qualified pool of respondents,
    and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding.
    Steve Fan
    TechNet Community Support

  • How to import OLM file into Outlook 2013?

    Last week, I switched to Windows 8 PC. It works fine but annoying with email application. Previous email backup file of Outlook 2011 (OLM) file was not supported by Outlook 2013 email application.
    Can anyone help to fix this one issue?

    Hi Smithazus,
    You face failure result due to bad practice of email migration. Before importing any email file in to new email client, please make sure few things as follows:
    Similar email file format
    Awareness with import process
    Safe environment for data safety
    Outlook 2013 uses PST file which is different from OLM files. In this context, you are advised to convert OLM files into PST file (Outlook 2013 supported file). As any manual method of such conversion is not available, you can try automated software which is developed by third party vendors.

  • How to import .pdf files into iBooks?

    How to import .pdf files into iBooks?

    Or send the file from your computer to your ipod by emailing yourself the pdf. Then if you open the Mail client and you open the pdf there is an option to select open in ibooks. It will save it to your device for remote viewing.

  • How to import mailbox files in Outlook 2013??

    How do I import Mozilla Thunderbird archived mailboxes in Microsoft Outlook 2013? I used Mozilla Thundebird in Mac book pro earlier, from some time I have been using Windows pc and for some reason I needed to access my older mails that I had archived from Mozilla Thunderbird. How do I import those files in Outlook 2013??
    Please help...!!

    Thunderbird mails cannot be directly imported into Outlook because of file format compatibility issues. Outlook can import .pst file format, so first we need to convert thunderbird mail to .pst format. This can be done here: http://www.gladwevsoftware.com/thunderbird-to-pst-converter/
    After that follow these steps to import the converted pst file in outlook 2013:-
    1. Click File > Open & Export > Import/Export.
    2. This starts the Import and Export Wizard.
    3. Choose Import from another program or file, and then click Next.
    4. Choose Outlook Data File (.pst) and click Next.
    5. Browse to the .pst file you want to import.
    6. Under Options, choose how you want to deal with duplicates
    7. Click Next.
    8. If a password was assigned to the Outlook Data File (.pst), enter the password, and then click OK.
    9. Set the options for importing items. The default settings usually don’t need to be changed.
    10. Click Finish.
    I hope this helps. thanks

  • How to Import XML file into SAP B1

    Dear All,
    I have a scenario like,
    I am receiving a XML file from a 3rd party application for the daily Creation,Update of Item Master,BP Master, Marketing Documents. I want to import this file into SAP B1 through its approp objects. I understand DTW has limitation in its file types (Semicolo,Tab,Comma,ODBC). How do i do this ? Please guide me.
    Thanks,
    Thanga Raj K

    Hy folks,
    I´m frim Brasil and I've been studying the tool EFM (Eletronic File Manager) to learn more about it!
    There I saw that we can extract to XML "any" infomation from the database we want, mainly through the GEP.
    However, as I've seen, this Add-On can not import any XML file into SBO, unless for the BFP wich can be imported in conjunction with the BTHF Add-on.
    So I ask: how is it possible to import XML data into SBO database? Is it possible to be done through the EFM? or  it´s really necessary to write a code specifically to do that?
    Besides, I know that de B1iSN fit to this necessity... but when I tried to use it, by the custom "object" for BP, for example, there are some data wich the mapping conteined in this custom "process" that can not be imported... I tried to understand how to map those other fields not imported by the custom but this has been dificult to me as I am a implementation consultant focused in administrative process not on development...
    Could you please help me with this subject!
    Thanks a lot,
    Denis

  • How to import .mpg files into FCE ?

    I have succesfully installed the MPEG StreamClip & flip4mac into my iMac. So now I can both play wmv files on my iMac as well as importing wmv files into iMovie & FCE.
    But now I have another problem:
    1) How do I play mpg files on my iMac ?
    2) How do I bring import mpg files into FCE ?
    Thank you.

    R. Mitchell Fore wrote:
    QTPro gives you many more capabilities than the free player, but I don't think you need it to do anything you've described. You DO need the MPEG-2 Playback component. I'd start there, then see if you need any of the options provided by QTPro.
    Hi there,
    I have purchased the MPEG-2 Playback component from the Apple Store.
    I can now convert the mpg files to mov using the MPEG StreamClip.
    However, I cannot playback the original mpg files using QuickTime Player. I can only playback the original mpg files if I click on the mpg file then goto more info & change open with MPEG StreamClip.
    But how do I open with QuickTime MPEG-2 playback ? I do not even know where the OS installed the MPEG-2 Playback component to ?
    Thanks

  • How to import Dropbox files into iPhoto?

    I have more than 1000 JPEG files in 3 different subfolders under the DropBox Pictures folder. I want to use them in some apps that only work with photos on the camera roll. I can find all kinds of advice on how to get individual files into the camera roll but I haven't found any on how to do multiple files in a batch. I'm assuming I need to go through iPhoto. I'm not very familiar with it because I seldom use the camera. I work mainly with JPEG files from external sources. I'm running IOS 7.1.1 on an iPad Air. I'd appreciate any suggestions. Thanks!

    I don't know whether to be more irritated with Apple for not providing a batch mechanism or with the app developers for restricting their input to the camera roll (unless that's an Apple requirement).
    The lack of a batch mechanism is annoying, but the restriction to the Camera Roll is built deep into the saftety restriction for IOS devices. Apps are restricted to their "Sandbox", and the Camera Roll is the central sharing place for photos on iOS devices. There is no way to circumvent this.
    Maybe, your problem to get the photos into the Camera Roll is due to using Dropbox and not one of Apple's own provided tools to transfer the photos,  see the list of possibilities to transfer photos between devices. For example, Photo Stream would save the photos automatically to the Camera Roll. Or use iTunes Photos sync.
    http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnka7d353af
    Once you can make iPhoto see the photos in an album, you can batch-save them to to camera roll: (http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnkee26bc1f)
    Save photos to the Camera Roll on your iOS device
    Tap a photo, album, or event and tap the share button > Camera Roll.
    Tap Selected, or change the photos you want to save:
    Select different photos: Tap Choose Photos, tap up to 100 photos, and tap Next.
    Select a range of photos: Tap Choose Photos, tap Range, tap the first and last photos in the range, and tap Next.
    Select all the photos in an album or event: Tap All.
    Tap Done.
    To use your photo in another app, open the app and select the Camera Roll album.

  • How to import "static files" into HTMLDB 2.0

    Hello!
    I have a problem with "static files" in HTMLDB 2.0.
    First i exported the "static files" from a workspace.
    the result is a ".sql" file.
    now i want to import this file into another workspace.
    but in HTMLDB theres no option to import "static files".
    Hope someone could help me to solve this problem!
    Best regards
    Bastian

    Bastian - Sorry, that facility is not in 2.0. You'll have to import static files into the new workspace individually.
    Scott

  • How to import .exe files into Captivate

    I have some Flash .exe files that I want to import into
    Captivate so I can combine the files....and also so I can choose
    the properties for the files (for example, either to run on a loop
    or also to take to a website upon completion).
    So, how do I import .exe files into Captivate?

    Hi Steve
    Unless you can find some sort of a converter out on the web,
    I think you are out of luck. I am aware of the SoThink SWF
    decompiler (
    http://www.sothink.com/product/flashdecompiler
    ) but I'm somewhat doubtful it will work on .EXE files. Perhaps it
    will.
    Cheers... Rick

  • How to import Flac files into itunes

    Hi there,
    the title say it all. How can I import Flac files into Itunes?
    I have a lot of them. I click onto add to library select the flac file, click on open and nothing happen.
    Many thanks for your help.
    regards

    Hello CESNET the best bet is to try http://blowintopieces.com/fluke/ I myself don't use Flac files but to any audiophile it's important to hear sound at it's best. Also WAV or AIFF & ALAC you will need to use http://tmkk.hp.infoseek.co.jp/xld/index_e.html to convert into ALAC.
    P.S. their is also a simple FLAC player but can't remember it one more thing converting FLAC to WAV will not give you full TAGs. Best bet is to try just one file you've copied ether straight into iTunes or convert & see what's best for you.

  • How to import .docx files into InDesign

    How to import .docx into InDesign page layout

    File > Place.
    For detailed explanation and techniques: An overview of placing (importing) Word files into InDesign from the Course Using Word and InDesign Together

  • Access denied. When trying to upload files into SharePoint with PowerShell

    AM trying to upload a bunch of files into SharePoint using PowerShell. I have a code that works on my local machine, but when I get on the server, it does not. Here is what my block of code looks like
    $webUrl = "http://SampleSite"
    $libraryName = "My Lib"
    $docLibraryUrlName = "My%20ContentType"
    $fileLocation = "C:\test\"
    $contentType = "My ContentType"
    #Open web and library
    $web = Get-SPWeb $webUrl
    $docLibrary = $web.Lists[$libraryName]
    $files = ([System.IO.DirectoryInfo] (Get-Item $fileLocation)).GetFiles()
    ForEach($file in $files)
    #Open file
    $fileStream = ([System.IO.FileInfo] (Get-Item $file.FullName)).OpenRead()
    # Gather the file name
    $FileName = $File.Name
    #remove file extension
    $NewName = [IO.Path]::GetFileNameWithoutExtension($FileName)
    #split the file name by the "-" character
    $FileNameArray = $NewName.split("_")
    #Add file
    #$folder = $web.getfolder($docLibraryUrlName)
    $folder = $web.getfolder($docLibrary)
    write-host "Copying file " $file.Name " to " $folder.ServerRelativeUrl "..."
    $spFile = $folder.Files.Add($folder.Url + "/" + $File.Name, $fileStream, $true)
    $spItem = $spFile.Item
    #populate metadata
    $spItem["First Column"] = $FileNameArray[0]
    $spItem["Second Column"] = $FileNameArray[1]
    $spItem.Update()
    $fileStream.Close();
    Again, this code works fine on my local machine but doesn't when I move this to the server. When I step through the code, I noticed that when I look at the data returned for my $folder variable in this snippet
    $folder = $web.getfolder($docLibrary)
    It shows the EffectiveRawPermissions to be "Open, BrowseUserInfo, UserClientIntegration" on the server...however, the EffectiveRawPermissions on my local machine is "FullMask". Does this have any effect on the ability of my code to be
    able to upload the files into SP on the server? I have never run into this issue, so am not sure how this makes sense...so I really appreciate any insight. Thanks
    I am getting this error when the code attempts to perform the "Add" function...
    Exception calling "Add" with "3" argument(s): "<nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied."
    At C:\PowerShellScripts\tester.ps1:70 char:3
    +         $spFile = $folder.Files.Add($folder.Url + "/" + $File.Name, $fileStream, $true ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : UnauthorizedAccessException
     ...Please help

    RunWithElevatedPriv basically impersonates the webapp's app pool account, which should have full control over the entire webapp... this would work, but is not recommended for several reasons:
    - first and foremost, you shouldn't NEED to bypass the SP security model
    - second and still important, the app pool may be hosting other webapps as well, so the risk of a bug causing security-related problems within the RunWithElev codeblock is no longer scoped to the current webapp, but also other webapps that share the same
    app pool account.
    - third, same as number two, but for service accounts, and possibly even the farm... not a good practice, but a lot of SP installs aren't configured correctly, so the entire farm may be using one account... now, the RunWithElev is not just a webapp admin,
    not just a multiple webapp admin, but may be able to affect service apps, or possibly the entire farm.
    - fourth, the audit info (created by, modified by) will reference the system account, instead of your account... not a very accurate audit trail in that case.
    If you have a legit need to add the files, you should be able to get the necessary permissions (which is basically just contribute within the library / folder) easily enough.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Import .msg files into address book

    Hi, apple users out there.
    When I bought my new MacBook, people at the apple store transferred all my data from my old PC to the laptop. For some reason, the addresses in Outlook were the only exceptions. Now I am trying to do it myself, but having trouble with it.
    My husband managed to extract them from Outlook in a .msg format. Mac is not happy and won't open it in the address book nor any other application.
    Any ideas how to get these addresses into the Address Book without having to type all 200 of them?
    Thanx!

    My husband managed to extract them from Outlook in a .msg format
    Contacts/Addresses are not message (.msg) files.
    Search Google for: outlook contacts to apple address book and you'll find many ways to do it.

  • Importing vcf files into Outlook issue

    I have exported some PALM contacts as .vcf files and now I am trying to import them into Outlook. In PALM, I have the business number listed as Main so Outlook doesn't import the number into the business field.
    How do I configure Outlook so that it recognizes this as the business number?
    Thanks.
    Post relates to: Palm IIIx

    I suspect you will need to edit the files, because Outlook's import function does not let you map custom fields when you choose .vcf import. (If the following is too much of a pain, consider exporting in a tabular format such as comma-separated or tab-separated. You can open that file in Excel or a text editor to remove the records you do not want to import into Outlook.)
    Can you open one of the .vcf files in Notepad or Wordpad and confirm that the "Main" number is on a line that starts with the following:
    TEL;PREF:
    If so, then you can use a VBScript to change that to:
    TEL;WORK:
    so that Outlook will interpret it as a Business number.
    I have posted the script file at the following address:
    http://jeffersonscher.com/res/MainToBusiness_vbs.t​xt
    The one-time setup is as follows: After inspecting the file to confirm that it doesn't do anything dangerous, you will need to save it to your hard drive with a .vbs extension. Once it is saved in a convenient location, right-click it and create a shortcut. Then move that shortcut into your Send To folder:
    c:\documents and settings\username\SendTo
    Setup is done. You now can edit the Palm .vcf files by right-clicking, choosing Send To, then the name of your SendTo shortcut. The edited file will appear in the same folder as your .vcf file, with "_edited" added into the original name.
    Hope this helps.
    Post relates to: Treo 800w (Sprint)

Maybe you are looking for