Page 1 of 6 123 ... LastLast
Results 1 to 20 of 106

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Two Exchange Accounts (ActiveSync)

  1. #1
    Default Two Exchange Accounts (ActiveSync)
    I do not know if this is limited to any number of Exchange ActiveSync push accounts but I currently have two working side-by-side. Here is how:

    Setup one Exchange account on your phone.

    SSH into your phone and edit /private/var/mobile/Library/Preferences/com.apple.accountsettings.plist

    Look for the section that covers your current Exchange account, copy it and paste it below the current entry. Edit the value of ASAccountEmailAddress and Identifier. Save the file.

    Go to Settings and under mail accounts you will see one with the value you assigned to ASAAccountEmailAddress, edit this account and change the server, username, and password to your second Exchange server.

    Here is a copy of my files will only the email addresses and server names changed.

    Code:
    {
        Accounts =     (
                    {
                Class = DeviceLocalAccount;
                "Enabled Dataclasses" =             (
                    "com.apple.Dataclass.Bookmarks",
                    "com.apple.Dataclass.Notes"
                );
                Identifier = DeviceLocalAccount;
                "Short Type String" = "On My iPod touch";
                Type = OnMyDevice;
                "Type String" = "On My iPod touch";
            },
                    {
                AccountPath = "/var/mobile/Library/Mail/Mailboxes";
                Class = LocalAccount;
                DraftsMailboxName = Drafts;
                Identifier = "A49ABBBD-04BB-4AF8-B95C-C351A63F1D8F";
                SentMessagesMailboxName = "Sent Messages";
                "Short Type String" = Local;
                "Sync Identifier" = LocalAccountId;
                TrashMailboxName = "Deleted Messages";
                Type = Mail;
                "Type String" = Local;
            },
                    {
                ASAccountEmailAddress = "[email protected]";
                ASAccountHost = "server1.com";
                ASAccountMailNumberOfPastDaysToSync = 0;
                ASAccountUseSSL = 1;
                ASAccountUsername = "[email protected]";
                ASLastKnownProtocolVersion = "12.1";
                Class = ASAccount;
                DAAccountPersistentUUID = "BE5EC6C9-B1C0-4B21-8E03-6F4885748682";
                DAAccountVersion = 2;
                DisplayName = "server1.com";
                "Enabled Dataclasses" =             (
                    "com.apple.Dataclass.Calendars",
                    "com.apple.Dataclass.Contacts",
                    "com.apple.Dataclass.Mail",
                    "com.apple.Dataclass.ContactsSearch"
                );
                Identifier = "30FD82D3-411D-40FF-A609-A70D4A85252E";
                "Short Type String" = Exchange;
                "Sync Identifier" = "30FD82D3-411D-40FF-A609-A70D4A85252E";
                Type = Exchange;
                "Type String" = "Exchange ActiveSync";
                kASAccountVersionKey = 7;
            },
                    {
                ASAccountEmailAddress = "[email protected]";
                ASAccountEmailAddresses = "[email protected]";
                ASAccountHost = "server2.com";
                ASAccountMailNumberOfPastDaysToSync = 0;
                ASAccountUseSSL = 1;
                ASAccountUsername = "[email protected]";
                ASLastKnownProtocolVersion = "12.1";
                Class = ASAccount;
                DAAccountPersistentUUID = "BE5EC6C9-B1C0-4B21-8E03-6F4885748682";
                DAAccountVersion = 2;
                DisplayName = server2.com;
                "Enabled Dataclasses" =             (
                    "com.apple.Dataclass.Calendars",
                    "com.apple.Dataclass.Contacts",
                    "com.apple.Dataclass.Mail",
                    "com.apple.Dataclass.ContactsSearch"
                );
                Identifier = "31C7D34D-2CFD-41FF-8A46-2819D2DE47A1";
                "Short Type String" = Exchange;
                "Sync Identifier" = "31C7D34D-2CFD-41FF-8A46-2819D2DE47A1";
                Type = Exchange;
                "Type String" = "Exchange ActiveSync";
                kASAccountVersionKey = 7;
            }
        );
        Version = 4;
    }
    I should state that I haven't used this long enough to comment on battery life.

    Last edited by drivesoslow; 11-12-2009 at 06:38 AM. Reason: Automerged Doublepost

  2. The Following 13 Users Say Thank You to drivesoslow For This Useful Post:

    beachen (11-23-2009), DCBnG (11-19-2009), Digitalpulse (01-07-2010), feinhorn (11-13-2009), gman2k4 (12-04-2009), jiffyj (11-22-2009), lolento (11-06-2009), longstrider (11-16-2009), pwandz (11-17-2009), Spamdumpster (11-12-2009), terranaut (01-16-2010), twon (11-17-2009), WillSDCA (12-08-2009)

  3. #2
    Brilliant!! Nice work. I've been waiting for someone to figure this out for ages. Thanks!

  4. #3
    DAAccountPersistentUUID may need to be altered also on the second account

  5. The Following User Says Thank You to drivesoslow For This Useful Post:

    WillSDCA (12-08-2009)

  6. #4
    You are a genius!!! I just did it and this works like a charm!

  7. #5
    I'm a day into running this mod and there does not seem to be any adverse battery effect.

  8. #6
    HOLY SMOKES!!!!

    I will try it but if this is working, please STICKY

    Guys,

    please comment if push mail, push calendar, and push contacts work on both accounts?

    thanks,
    Last edited by lolento; 11-06-2009 at 01:39 PM. Reason: Automerged Doublepost

  9. #7
    I have calendar, mail, and contacts working on both accounts

  10. The Following User Says Thank You to drivesoslow For This Useful Post:

    lolento (11-06-2009)

  11. #8
    drivesoslow,

    thanks for the feedback, I'm going to try it now...

    does this method merge the calendar and contacts?
    For example, if I have a work exchange account and a google exchange account does the calendar events in my work exchange account get sync into my google account? (I don't want this to happen)
    Also, if I have same contacts in my work exchange account and my google account, will I see double entries? (I don't want this either)

    thanks!

    One more question, when you create a Calendar item on the iphone does it sync to both accounts?
    Last edited by lolento; 11-06-2009 at 03:18 PM. Reason: Automerged Doublepost

  12. #9
    My battery seems to be draining a bit more than normal, but I am more than willing to keep a charger handy for this functionality!

  13. #10
    Answering my own questions...

    Yes, you will have double contacts if you have same contacts on both accounts...

    But calendar events are separate.

    Adding calendar events can be done selectively to one account.

    GOOD WORK DRIVESOSLOW! LOVING IT!

    Also, you're right, DAAccountPersistentUUID need to be different on both accounts (so please correct the op).
    Last edited by lolento; 11-06-2009 at 04:10 PM.

  14. #11
    iPhone? More like MyPhone posrjak's Avatar
    Join Date
    Sep 2007
    Location
    PDX
    Posts
    195
    Thanks
    15
    Thanked 7 Times in 7 Posts

    I have tried this serval times and it just lists the last exchange acount on my plist. Which ever one I put the information in second on the plist is list in email settings. I am using plist editor for windows on windows xp and I have 32 gig 3gs. Not sure what I am doing wrong, can any on provide advice?

    <dict>
    <key>ASAccountEmailAddress</key>
    <string>[email protected]</string>
    <key>ASAccountHost</key>
    <string>m.google..com</string>
    <key>ASAccountMailNumberOfPastDaysToSync</key>
    <integer>0</integer>
    <key>ASAccountUseSSL</key>
    <true/>
    <key>ASAccountUsername</key>
    <string>[email protected]</string>
    <key>ASLastKnownProtocolVersion</key>
    <string>2.5</string>
    <key>Class</key>
    <string>ASAccount</string>
    <key>DAAccountPersistentUUID</key>
    <string>47F76882-2678-41C7-91B9-5D1AD5F76BFA</string>
    <key>DAAccountVersion</key>
    <integer>2</integer>
    <key>DATrustSettingsExceptions</key>
    <dict>
    <key>b8fa0b7f 0e99494e e3210953 21fa4725 65454492</key>
    <data>
    YnBsaXN0MDChAdICAwQFW1NTTEhvc3RuYW1lWlNIQTFE
    aWdlc3QITxAUuPoLfw6ZSU7jIQlTIfpHJWVFRJIICg8b
    JicAAAAAAAABAQAAAAAAAAAGAAAAAAAAAAAAAAAAAAAA
    Pg==
    </data>
    </dict>
    <key>DisplayName</key>
    <string>Gmail</string>
    <key>Enabled Dataclasses</key>
    <array>
    <string>com.apple.Dataclass.Calendars</string>
    <string>com.apple.Dataclass.Contacts</string>
    <string>com.apple.Dataclass.Mail</string>
    <string>com.apple.Dataclass.ContactsSearch</string>
    </array>
    <key>Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Short Type String</key>
    <string>Exchange</string>
    <key>Sync Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Type</key>
    <string>Exchange</string>
    <key>Type String</key>
    <string>Exchange ActiveSync</string>
    <key>kASAccountVersionKey</key>
    <integer>7</integer>
    </dict>
    <dict>
    <key>ASAccountEmailAddress</key>
    <string>[email protected]</string>
    <key>ASAccountHost</key>
    <string>acount2.workemail.com</string>
    <key>ASAccountMailNumberOfPastDaysToSync</key>
    <integer>0</integer>
    <key>ASAccountUseSSL</key>
    <true/>
    <key>ASAccountUsername</key>
    <string>acount2</string>
    <key>ASLastKnownProtocolVersion</key>
    <string>2.5</string>
    <key>Class</key>
    <string>ASAccount</string>
    <key>DAAccountPersistentUUID</key>
    <string>47F76882-2678-41C7-91B9-5D1AD5F76BFF</string>
    <key>DAAccountVersion</key>
    <integer>2</integer>
    <key>DATrustSettingsExceptions</key>
    <dict>
    <key>b8fa0b7f 0e99494e e3210953 21fa4725 65454492</key>
    <data>
    YnBsaXN0MDChAdICAwQFW1NTTEhvc3RuYW1lWlNIQTFE
    aWdlc3QITxAUuPoLfw6ZSU7jIQlTIfpHJWVFRJIICg8b
    JicAAAAAAAABAQAAAAAAAAAGAAAAAAAAAAAAAAAAAAAA
    Pg==
    </data>
    </dict>
    <key>DisplayName</key>
    <string>acount2</string>
    <key>Enabled Dataclasses</key>
    <array>
    <string>com.apple.Dataclass.Calendars</string>
    <string>com.apple.Dataclass.Contacts</string>
    <string>com.apple.Dataclass.Mail</string>
    <string>com.apple.Dataclass.ContactsSearch</string>
    </array>
    <key>Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Short Type String</key>
    <string>Exchange</string>
    <key>Sync Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Type</key>
    <string>Exchange</string>
    <key>Type String</key>
    <string>Exchange ActiveSync</string>
    <key>kASAccountVersionKey</key>
    <integer>7</integer>
    </dict>

  15. #12
    Did you change:

    <key>Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    on one of the two accounts, they cannot match?

  16. #13
    iPhone? More like MyPhone posrjak's Avatar
    Join Date
    Sep 2007
    Location
    PDX
    Posts
    195
    Thanks
    15
    Thanked 7 Times in 7 Posts

    I chanced it by one letter, not really sure what to change.

  17. #14
    All i can suggest it to convert the file to xml and try using a text editor.

    Personally I ssh'd into my phone and ran
    Code:
    plutil -convert xml1 /private/var/mobile/Library/Preferences/com.apple.accountsettings.plist
    vim /private/var/mobile/Library/Preferences/com.apple.accountsettings.plist
    and edited it through VIM.

  18. #15
    Quote Originally Posted by posrjak View Post
    I chanced it by one letter, not really sure what to change.
    I just used word search on my web browser....you have the same identifier on both accounts

    u didn't even change one letter, check it.

  19. #16
    I can confirm that this works extremely well.

    The Identifier and the SyncIdentifier both have to be modified, however.

  20. #17
    I imagine there has to be a way to hack Preferences.app to not warn about creating multiple Exchange accounts. A simple patch installed through Cydia would make this hack much easier.
    Last edited by drivesoslow; 11-10-2009 at 05:25 PM.

  21. #18
    Angry No such luck
    Been at this for two hours now. Grrr.

    I copied the entire block of code from the first Exchange account and have modified the following fields in the plist file (I kept adding to the fields I modded until I got a little further each time):

    ASAccountEmailAddress
    ASAccountEmailAddresses
    DAAccountPersistentUUID
    Identifier
    Sync Identifier

    Both the ASAccountEmailAddress and ASAccountEmailAddresses are my new address (exhange e-mail account #2). For DAAccountPersistentUUID, Identifier and Sync Identifier I've altered one digit in each. Both Identifier and Sync Identifier have the same modification (they're the same, but different than the pair in the first exchange account).

    When I view the account in the iPhone, it looks okay, but I have to modify my user name, server name and password the first time I enter the settings screen for this account. If I go "back" and re-enter the settings, it won't accept the changes the second time around. I have to respring at this point to enter in more changed from the GUI.

    Finally, when all looks like it's working, I click "mail" in the iPhone (I have mail sync on in settings for this new exchange account) and I get taken to the "choose your account type" screen, i.e. the screen that you get when you click "add an account" in Mail Settings, as if I didn't have any accounts set up on the iPhone at all. This is a problem.

    The only thing I don't really understand is what the point is of changing the Identifier field way at the top of the plist field, not the Identifier field actually within the Exchange account dict. I've done both - both that first Identifier and not mod it. It doesn't seem to have any effect.

    So basically, it doesn't work.

    I should mention I'm running BlainRa1n 3.1.2 with UltraSn0w on the iPhone, if it matters.

  22. The Following User Says Thank You to kaplansa For This Useful Post:

    pwandz (11-17-2009)

  23. #19
    Post your file so we can look at it

    Also when you change those identifiers they need to match each other.
    Last edited by drivesoslow; 11-12-2009 at 06:46 AM. Reason: Automerged Doublepost

  24. #20
    I can confirm too that this works well. It took me a couple of tries to get the editing of the plist right, but now it works. Work and gmail - both push + work contacts + work and 2 gmail calendars. All push. All awesome.

Page 1 of 6 123 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •