-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42b3953
commit 6bad022
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute> | ||
<displayName>Outlook REST Calendar Sync</displayName> | ||
<description/> | ||
<dataType>string</dataType> | ||
<scriptContentsMac>#!/bin/sh | ||
|
||
# Functions | ||
function isRESTEnabled { | ||
# creates a list of local usernames with UIDs above 500 (not hidden) | ||
userList=$( /usr/bin/dscl /Local/Default -list /Users uid | /usr/bin/awk '$2 >= 501 { print $1 }' ) | ||
|
||
while IFS= read aUser | ||
do | ||
# get the user's home folder path | ||
HOMEPATH=$( eval /bin/echo ~$aUser ) | ||
|
||
# grab the device id from the Office365ServiceV2 log | ||
local RESULT=$(/usr/bin/grep -m1 'cv4oz' $HOMEPATH/Library/Containers/com.microsoft.Outlook/Data/Library/Caches/Microsoft/uls/com.microsoft.Outlook/logs/*.log | grep '"IsSetupForRESTCalendarSync": true') | ||
|
||
# checks to see if we got a hit | ||
if [ "$RESULT" != "" ]; then | ||
REST="True" | ||
else | ||
REST="False" | ||
fi | ||
done <<< "$userList" | ||
|
||
/bin/echo "$REST" | ||
} | ||
|
||
## Main | ||
RESTENABLED=$(isRESTEnabled) | ||
/bin/echo "<result>$RESTENABLED</result>" | ||
|
||
exit 0</scriptContentsMac> | ||
<scriptContentsWindows/> | ||
</extensionAttribute> |