Personal Outlook Emails

Josiah_Mensah
New Contributor II

We are currently looking to implement some preferences to Outlook.

We have configurations to block users from adding personal emails but is there a way to report on how many users have personal emails added and how to remove them 

 

Thanks

 

 

1 ACCEPTED SOLUTION

Josiah_Mensah
New Contributor II

I managed to speak to Microsoft and they mentioned a file path that contained the email addresses, so i was able to create this extension attribute below and used an advanced search to export a CSV

 

#!/bin/bash

# Get the currently logged-in user's username
username=$(stat -f "%Su" /dev/console)

# Set the path to the ProfilePreferences.plist file
plist_path="/Users/${username}/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/ProfilePreferences.plist"

# Check if the file exists
if [ -f "$plist_path" ]; then
# Use grep to search for the key "ActionsEndPointURLFor" and print the matching lines to the console
echo "<result>$(grep ActionsEndPointURLFor "$plist_path" | grep -o '[^/]*@[^/]*')</result>" | sed 's/ActionsEndPointURLFor//g'
else
# If the file doesn't exist, output an error message
echo "<result>File not found</result>"
fi

View solution in original post

3 REPLIES 3

AJPinto
Honored Contributor II

I recommend opening a ticket with Microsoft. It may be possible to read the mail file to see what email accounts have been setup, but this is very much a Microsoft product question. 

Josiah_Mensah
New Contributor II

I managed to speak to Microsoft and they mentioned a file path that contained the email addresses, so i was able to create this extension attribute below and used an advanced search to export a CSV

 

#!/bin/bash

# Get the currently logged-in user's username
username=$(stat -f "%Su" /dev/console)

# Set the path to the ProfilePreferences.plist file
plist_path="/Users/${username}/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/ProfilePreferences.plist"

# Check if the file exists
if [ -f "$plist_path" ]; then
# Use grep to search for the key "ActionsEndPointURLFor" and print the matching lines to the console
echo "<result>$(grep ActionsEndPointURLFor "$plist_path" | grep -o '[^/]*@[^/]*')</result>" | sed 's/ActionsEndPointURLFor//g'
else
# If the file doesn't exist, output an error message
echo "<result>File not found</result>"
fi

Mayank
New Contributor

Hello, Give a try to below terminal script it. You need to enter only the domains which you want to be added to your test tenant and then check the behaviour.

Terminal script:  defaults write com.microsoft.Outlook AllowedEmailDomains -array "domain1.com" "domain2.com" "domain3.com'

Note: This script will restrict the user to configure a personal mailbox in the Outlook app but it will not restrict a user already configured a personal mailbox in the Outlook app.