HighTechTalks DotNet Forums  

Setting Active Sync settings from code (C#)

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss Setting Active Sync settings from code (C#) in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
patrik.loren@home.se
 
Posts: n/a

Default Setting Active Sync settings from code (C#) - 10-01-2007 , 03:11 AM






Hi, I need to be able to set upp a phone (both Windows Mobile 6 &
Windows Mobile 6 Professional) with specific settings for Active Sync.
I need to do this with C#.
The settings I need to set are:
Exchange server
Domain
SSL-connection
Scheduling of sync (both setting up times and sync interavalls)
SyncWhenRoaming (Found this in a good place in registry)
Which parts to sync:contacts, agenda (timespann), mail (timespann,
messageformat, size), tasks

I know some of these things are in the registry but have maybe
different keys on different phones, i need a good way of doing
this...Is it possible to connect to an activesync-object to set these
things...???

regards
Patrik Loren


Reply With Quote
  #2  
Old   
Peter Foot [MVP]
 
Posts: n/a

Default Re: Setting Active Sync settings from code (C#) - 10-01-2007 , 07:03 AM






You need to use the Sync service provider:-
http://msdn2.microsoft.com/en-us/library/aa455976.aspx

From managed code you would use ConfigurationManager.ProcessConfiguration
with an XML document containing the settings. The link above describes the
service provider and has a few examples.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

<patrik.loren (AT) home (DOT) se> wrote

Quote:
Hi, I need to be able to set upp a phone (both Windows Mobile 6 &
Windows Mobile 6 Professional) with specific settings for Active Sync.
I need to do this with C#.
The settings I need to set are:
Exchange server
Domain
SSL-connection
Scheduling of sync (both setting up times and sync interavalls)
SyncWhenRoaming (Found this in a good place in registry)
Which parts to sync:contacts, agenda (timespann), mail (timespann,
messageformat, size), tasks

I know some of these things are in the registry but have maybe
different keys on different phones, i need a good way of doing
this...Is it possible to connect to an activesync-object to set these
things...???

regards
Patrik Loren



Reply With Quote
  #3  
Old   
patrik.loren
 
Posts: n/a

Default Re: Setting Active Sync settings from code (C#) - 10-04-2007 , 05:20 AM



Hi Peter! Thank's for the link!

I've looked into these xml-configurations... Having some
securityproblems I guess...
After I've run the .cpf I get an sms telling me that is failed and not
authorized...

Should i use registry enries for some to reduse risk of security
issues...
The xml I try to config with is this:
<wap-provisioningdoc>
<characteristic type="Sync">
<characteristic type="Calender">
<parm name="CalenderAgeFilter" value="4"/>
<parm name="Enabled" value="1"/>
</characteristic>
<characteristic type="Connection">
<parm name="AllowSSLOption" value="0"/>
<parm name="Domain" value="eur.corp.vattenfall.com"/>
<parm name="Server" value="sync.vattenfall.de"/>
</characteristic>
<characteristic type="Contacts">
<parm name="Enabled" value="1"/>
</characteristic>
<characteristic type="Mail">
<parm name="EmalAgeFilter" value="4"/>
<parm name="Enabled" value="1"/>
<parm name="MailBodyTruncation" value="2048"/>
<parm name="MailFileAttachments" value="0"/>
</characteristic>
<characteristic type="Settings">
<parm name="OffPeakFrequency" value="0"/>
<parm name="PeakStartTime" value="08:00"/>
<parm name="PeakEndTime" value="17:00"/>
<parm name="PeakFrequency" value="60"/>
<characteristic type="PeakDays">
<parm name="Sun" value="0"/>
<parm name="Mon" value="1"/>
<parm name="Tue" value="1"/>
<parm name="Wed" value="1"/>
<parm name="Thr" value="1"/>
<parm name="Fri" value="1"/>
<parm name="Sat" value="0"/>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

/Patrik


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.