Tải bản đầy đủ - 0 (trang)
Chapter 22. Out Of Office Settings

Chapter 22. Out Of Office Settings

Tải bản đầy đủ - 0trang

message

[Viewfullsizeimage]



Youhaveanumberofoptionsavailabletoyouwhensetting

yourOOFsettings.Forexample,youcanconfigurethe

ExchangeServertosendOOFreplymessagesonlytointernal

e-mailaddresses(membersofyourorganization,forexample)

ortoincludeexternale-mailaddressesaswell.Anotheroption

allowsyoutoconfiguretheExchangeServertosendtoan

externale-mailaddressonlyifthate-mailaddressisaknown

e-mailaddress.TheExchangeServerconsidersaknowne-mail

addresstobeonethatispresentonanyofthecontactitemsin

yourContactsfolder

Note

MicrosoftExchangeServer2007allows

administratorstosetanorganizational

policythatcanrestrictthesendingofOOF

messages.Thispolicycanpreventthe



ExchangeServerfromsendingOOFreply

messagestoanyandallexternale-mail

addresses,ortoallowOOFreplymessages

tobesenttoexternale-mailaddresses

onlyiftheyareknowne-mailaddresses.

ThischapterwillnotgointohowthisOOF

replymessagepolicyisdefined,butwewill

explainhowyoucanfindoutwhatthe

policysettingis.



AnotheroptionyouhavewithOOFsettingsistoconfigurethe

ExchangeServertosendOOFreplymessagesonlyduringa

specifieddaterange.ThisisknownasascheduledOOF.

Important

WhenyousetyourOOFsettingsvia

ExchangeWebServices,ExchangeWeb

Serviceswillnotautomaticallysetthe

free/busystatusonyourcalendartoOOF.

Inotherwords,settingyourOOFsettings

viaExchangeWebServiceswillinform

peoplewhosendyouane-mailmessage

thatyouareoutoftheofficebasedonthe

OOFreplymessagetheygetback.

However,peoplewhoaskforyour

availability(viatheGetUserAvailabilityWeb

method,forexample)wouldnotseethat

youareOOFunlessyoualsohavea

calendariteminyourCalendarfolderwith

afree/busystatusofOOFfortheduration

oftimeyouaregone.



IntroducingtheSetUserOofSettingsWeb

Method

YoucansetyourOOFsettingswithExchangeWebServicesby

callingtheSetUserOofSettingsWebmethod.Tocallthe

SetUserOofSettingsWebmethodviaXML,yousupplya

SetUserOofSettingsRequestelementinyourcall.Theschema

typeforaSetUserOofSettingsRequestelementisalsonamed

SetUserOofSettingsRequest,andisshowninListing22-1

Listing22-1.SchemafortheSetUserOofSettingsRequest

type























Note

Intheproxyclasses,the

SetUserOofSettingsWebmethodiscalled

withtheSetUserOofSettingsmethodon

yourExchangeServiceBindinginstance.

Notethatthenamingisslightlydifferent.

WhenusingXML,yousupplya

SetUserOofSettingsRequestelementas

opposedtoaSetUserOofSettingselement.



Thesameappliestothe

GetUserOofSettingsWebmethodwherethe

proxyclassmethodisGetUserOofSettings

buttheXMLrequestelementisnamed

GetUserOofSettingsRequest.



Therearethreeflagsthatcanbeusedtoconfigurewhenandif

theExchangeServershouldsendOOFreplymessagesonyour

behalf.OneflagconfigurestheExchangeServertobegin

sendingOOFreplymessagesonyourbehalfinstantly,whilea

secondflagstopsOOFreplymessagesbeingsentonyour

behalfimmediately(forexample,whenyouarebackinthe

office).Athirdflagallowsyoutodefineawindowoftimewhen

OOFreplymessagesshouldbesent.

Important

LiketheGetUserAvailabilityWebmethod,the

SetUserOofSettingsWebmethod(andthe

GetUserOofSettingsWebmethodaswell)requiresthat

youspecifytheprimarySMTPaddressofyourmailboxin

yourMailboxelementevenifyouaretryingtosetorget

yourownOOFsettings.Whileyouareallowedtospecify

theprimarySMTPaddressofanothermailbox,Exchange

WebServiceswillreturna

Microsoft.Exchange.Data.Storage.AccessDeniedException

inaSOAPfaultunlessyouhaveowner-levelaccessto

thatmailboxaswell.



Listing22-2isanexampleofcallingtheSetUserOofSettings

WebmethodwithaSetUserOofSettingsRequestelementto



configuretheExchangeServertostartsendingOOFreply

messagesimmediately.Theexamplealsoshowshowtospecify

theOOFreplymessagebodythatshouldbesenttoallinternal

e-mailaddresses,andasecondOOFreplymessagebodythat

shouldbesenttoexternale-mailaddressesonlyiftheyare

knowne-mailaddresses.

Listing22-2.ExamplecalltotheSetUserOofSettingsWeb

method

CodeView:




xmlns:t=".../types">



carol@contoso.com





Enabled

Known





MyinternalOOFmessage.Thismessagewillbesentt

recipientswithinmyorganizationse-mailsystem.









MyexternalOOFmessage.Thismessagewillbesento

e-mailaddressesifthee-mailaddresshappenstobe

folder.ThisisbecausetheExternalAudienceelement

settoKnown.

































MailboxElementinSetUserOofSettingsRequest

TheMailboxelementinaSetUserOofSettingsRequestisofthe

schematypeEmailAddressshowninListing22-3.[1]

[1]



NottobeconfusedwiththeEmailAddressTypeschematype,whichhasbeen

usedextensivelyinthisbookalready.



Listing22-3.SchemafortheEmailAddresstype

CodeView:






































WhenusinganEmailAddressinaMailboxelementina

SetUserOofSettingsRequest,youneednotbeconcernedwith

theNameandRoutingTypeelements.Youneedtoprovideonly

theAddresselementwherethevalueistheprimarySMTP

addressofthemailboxyouaresettingOOFsettingsfor.



UserOofSettingsElementin

SetUserOofSettingsRequest

TheUserOofSettingselementinSetUserOofSettingsRequest

definesalloftheOOFsettingsoptionsthatareavailabletoyou.

TheUserOofSettingselementisdefinedbytheschematypeof

thesamename,whichisshowninListing22-4



Listing22-4.SchemafortheUserOofSettingselement






name="OofState"type="t:OofState"/>


name="ExternalAudience"

type="t:ExternalAudience"/>


name="Duration"type="t:Duration"/>


name="InternalReply"type="t:ReplyBody"/>


name="ExternalReply"type="t:ReplyBody"/>







OofStateElementinUserOofSettings

TheOofStateelementisarequiredstringthatmapstoavalue

fromtheOofStateenumerationshowninListing22-5

Listing22-5.SchemafortheOofStateenumeration

















SettingtheOofStatevaluetoEnabledwilltelltheExchange



ServertostartsendingOOFreplymessagesonyourbehalf

immediately.SettingtheOofStatevaluetoDisabledwilltellthe

ExchangeServertostopsendingOOFreplymessagesonyour

behalfimmediately.SettingtheOofStatevaluetoScheduledwill

telltheExchangeServertostartsendingOOFreplymessages

ataspecificdateandtostopsendingthematanotherspecific

date.ThestartdateandenddateforsendingOOFreply

messagesinscheduledOOFsettingsisdefinedintheDuration

elementofUserOofSettings,whichwewillexplainshortly.



ExternalAudienceElementinUserOofSettings

TheExternalAudienceelementisastringthatmapstoavalue

fromtheExternalAudienceenumerationshowninListing22-6.

Listing22-6.SchemafortheExternalAudience

enumeration

















IfyousettheExternalAudienceintheUserOofSettingselement

ofyourrequesttoNone,youaretellingtheExchangeServerto

notsendOOFreplymessagestoanyexternale-mailaddresses.

AsettingvalueofAllindicatesthatOOFreplymessagesshould

besenttoallexternale-mailaddresses.Settingthe

ExternalAudiencevaluetoKnowntellstheExchangeServerto

sendOOFreplymessagesonlytoknownexternale-mail

addresses.

AlloftheExternalAudiencevaluesaresubjecttothe



organization'sOOFreplymessagepolicythatwehavebeen

discussinginthischapter.Formoreinformationonthespecifics

ofhowtheOOFreplymessagepolicycanoverruleyour

ExternalAudiencevalue,seethesidebartitled"Determiningthe

EffectiveExternalAudienceValueina

GetUserOofSettingsResponse."

TheExternalAudienceelementisrequired,evenwhenyour

requestsetstheOofStatevaluetoDisabled.



DurationElementinUserOofSettings

TheDurationelementisofschematypeDuration,which,as

discussedpreviously,hasarequiredStartTimeelementanda

requiredEndTimeelement,bothoftypexs:dateTime.The

StartTimeandEndTimeelementsofaDurationelementin

UserOofSettingstellstheExchangeServerwhentostartand

stopsendingOOFreplymessagesonyourbehalfduringa

scheduledOOF.

Listing22-7showsanexampleofaSetUserOofSettingsRequest

withanOofStatevalueofScheduledandaDurationelement.

Listing22-7.ExamplecalltotheSetUserOofSettingsWeb

methodwithscheduledOOFsettings

CodeView:


xmlns:t=".../types">



carol@contoso.com





Scheduled

None



2007-07-21T08:00:00-05:00

2007-08-01T17:00:00-05:00









Iamsorry,butIamoutoftheofficefromJune15tht

Ifyouneedimmediateassistance,youcane-mailmyman

andy@contoso.com



































ExchangeWebServicesrequirestheDurationelementonlyif

theOofStatepropertyissettoScheduled.ExchangeWeb

ServiceswillreturnanInvalidScheduledOofDurationresponse

codeifyourrequesthasanOofStateofScheduledanddoesnot

includeaDurationproperty.ExchangeWebServiceswillalso

returnanInvalidScheduledOofDurationmessageifyour

Durationpropertyisinvalid,forexample,ifithasaStartTime

thatisgreaterthantheEndTimeorifithasanEndTimevalue

thatoccursinthepast.

Important

TheSetUserOofSettingsWebmethoddoes

nothaveapropertyfordescribingthe

request'stimezoneinformationforthe

Duration.Thismeansthatyoushould

alwaysspecifytheStartTimeandEndTime

date/timestringswithUTCoffsets.The

ExchangeWebServicesteamrecommends

alwaysusingUTCtimefordate/timestrings

inDurationelementsinacalltothe

SetUserOofSettingsWebmethod.



InternalReplyandExternalReplyElementsin

UserOofSettings

TheInternalReplyandExternalReplyelementsarebothofthe

ReplyBodyschematype,whichisshowninListing22-8

Listing22-8.SchemafortheReplyBodytype

CodeView:






































AReplyBodycontainsonlyoneelement,calledMessage,which

isastring.WhenusedinanInternalReplyelement,the

MessagevalueisthemessagebodythatwillbeusedforOOF

replymessagesdestinedforinternale-mailaddresses.When

usedinanExternalReplyelement,theMessagevalueisthe

messagebodythatwillbeusedforOOFreplymessages

destinedforexternale-mailaddresses.

TheReplyBodyschematypewillallowyoutospecifythe

languageoftheOOFreplymessagebodybyincludingthe

xml:langattribute.InInternalReplyorExternalReplyelements,

youwouldplacethisattributedirectlywithintheelementitself.

Listing22-9isanexampleofusinganInternalReplyelement

withanxml:langattribute.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 22. Out Of Office Settings

Tải bản đầy đủ ngay(0 tr)

×
x