Windows 10: Loop through all mail profiles using powershell

Discus and support Loop through all mail profiles using powershell in Windows 10 Software and Apps to solve the problem; Hi all, I have found a powershell script that loops through outlook registry key and searches for outlook profiles. I'm trying to find out if any... Discussion in 'Windows 10 Software and Apps' started by Tommytongify, Nov 19, 2018.

  1. Loop through all mail profiles using powershell


    Hi all,


    I have found a powershell script that loops through outlook registry key and searches for outlook profiles. I'm trying to find out if any users in the organization may have added any external mailboxes. This could either be in Outlook 2016 or older versions of Outlook or even in the Windows 10 Mail app which i don't think the script below catches.



    $profiles = (Get-ChildItem HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles).PSChildName


    foreach ($profile in $profiles) {
    $ol
    = New-Object -ComObject Outlook.Application
    $ol
    .Session.Logon("$profile")
    $ns
    = $ol.GetNamespace("MAPI")
    $ns
    .Accounts | ft Displayname,Username,SMTPAddress -AutoSize
    }


    Any suggestions?

    :)
     
    Tommytongify, Nov 19, 2018
    #1
  2. Brink Win User

    Mail app will not open on 10041.


    Hello Adam,

    This is the suggested solution below if you haven't already tried it. Loop through all mail profiles using powershell :)

    In this Windows 10 build 10041, the Mail, Calendar, and People apps may be broken due to a licensing issue with the Store Beta. To get these apps working again, you need to follow these steps:

    • Open powershell as administrator
    • Run the command Get-appxprovisionedpackage –online | where-object {$_.packagename –like “*windowscommunicationsapps*”} | remove-appxprovisionedpackage –online
    • Re-install Mail, People and Calendar from the Store (green tile)
     
    Brink, Nov 19, 2018
    #2
  3. CCC Profiles that disappear

    id suggest a spyware check
     
    eidairaman1, Nov 19, 2018
    #3
  4. philc43 Win User

    Loop through all mail profiles using powershell

    Cannot open mail app settings


    OK, my next suggestion was going to be uninstalling Mail and Calendar and reinstalling from the Windows Store. You can have a go at this by following these steps.

    1. Open the Start menu, type Windows PowerShell.
    2. Right click on the Windows PowerShell and select Run as administrator.
    3. Enter the below command to remove the Mail and calendar app.

    get-appxpackage *microsoft.windowscommunicationsapps* | remove-appxpackage

    After performing the above steps, install the Mail and calendar app from the Windows Store.

    Hope this helps, you will, of course, have to add you accounts back again.
     
    philc43, Nov 19, 2018
    #4
Thema:

Loop through all mail profiles using powershell

Loading...
  1. Loop through all mail profiles using powershell - Similar Threads - Loop through mail

  2. Updating Windows 10 through Powershell

    in Windows 10 Installation and Upgrade
    Updating Windows 10 through Powershell: I was just wondering if Windows 10 can be directy updated through Powershell without navigating through Settings> Update and Security. Is there a particular command that I can directly type and enter in powershell to update windows?...
  3. Using the YourPhone app through powershell

    in Windows 10 Software and Apps
    Using the YourPhone app through powershell: Hi there, I was wondering if there is any way to use the YourPhone app integrated in windows 10 through powershell commands. My intention would be to send an automated message from my phone by running a script. Is that possible and if so how do I achieve that? Thanks in...
  4. Windows Security through PowerShell

    in AntiVirus, Firewalls and System Security
    Windows Security through PowerShell: Is there a way to take action towards threats in Windows Security automatically through a PowerShell applet or cmd command? For example, I see that there was a threat detected, I could run a script on my desktop that quickly tells Windows Security to remove or allow the...
  5. Using Powershell to delete REG key for all users

    in Windows 10 Support
    Using Powershell to delete REG key for all users: Hey all, not sure if this is the right place to ask, especially considering how pointed the question is. We're trying to do a thorough clean install of a software due to changing the version (specifically, we're moving from SolidWorks 2017 to 2020 SP04). However, the issue...
  6. Batch Numbering Files through Powershell

    in Windows 10 Network and Sharing
    Batch Numbering Files through Powershell: Hello, I'm trying to come up with a solution through Powershell that batch numbers files at the beginning of a file name without interrupting the rest of the file name. For example: Current File Names: John Smith.pdf Abel Anderson.pdf Mary Trinity.pdf ..... Rocky...
  7. PowerShell profile

    in Windows 10 Network and Sharing
    PowerShell profile: Hi I had a PowerShell profile that worked fine with Windows 7 (PS v3): <code> #CSOM first [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")...
  8. Changing all files with no extension in the folder using powershell

    in Windows 10 Network and Sharing
    Changing all files with no extension in the folder using powershell: I don't know how to change extensions of all files in my folder. All files don't have any extension and I dont know how to do it with powershell. How do I change it so all of them have extensions?...
  9. moving all mail and profiles

    in User Accounts and Family Safety
    moving all mail and profiles: trying to move all my old mail from old laptop with win7 that I used thunderbird on to new laptop with win10 and the mail client that came with it or to outlook. Could use any help at all....
  10. How to Delete all SMBshares using Powershell?

    in Windows 10 Network and Sharing
    How to Delete all SMBshares using Powershell?: I've disabled SMB in "Turn Windows Features On or Off". How can I remove the SMBShares that return the following error when I enter remove-smbshare <Sharename>? Sample Error: remove-smbshare : The request is not supported.At line:1 char:1+ remove-smbshare <Sharename>$+...

Users found this page by searching for:

  1. powershell to query outlook and owa profile