CreateManagedFolder 操作

CreateManagedFolder 操作では、Exchange ストアにマネージド フォルダーが作成されます。

CreateManagedFolder 操作の使用

CreateManagedFolder 操作は、マネージド カスタム フォルダーをユーザーのメールボックスに追加します。 Exchange Management Shell Get-ManagedFolder コマンドレットを使用して、追加する使用可能なマネージド フォルダーを見つけることができます。 このコマンドレットは、マネージド カスタム フォルダーとマネージド 既定のフォルダーの両方を返しますが、追加できるのはマネージド カスタム フォルダーのみです。 マネージド カスタム フォルダーは、ManagedCustomFolder フォルダーの種類によって識別されます。 System.DirectoryServices 名前空間には、使用可能なマネージド フォルダーの名前を検出するために使用できる型も含まれています。

注:

Exchange Web サービスを使用して、メールボックスに追加できるマネージド フォルダーの名前を検索することはできません。

FindFolder 操作と GetFolder 操作を使用して、マネージド フォルダーにアクセスできます。 FindFolder は、指定された親フォルダー内のフォルダーを検索するために使用されます。 これは、重複するマネージド カスタム フォルダーを同じディレクトリに追加する前に、フォルダー内でマネージド フォルダーを検出できるように使用できます。 GetFolder は、FindFolder 操作の後に使用され、マネージド カスタム フォルダーに関する詳細情報を取得します。

注釈

メッセージング レコード管理 (MRM) ポリシーを設定する方法については、「 管理フォルダー メールボックス ポリシーを作成する方法」を参照してください。

メールボックスからマネージド カスタム フォルダーを削除する方法の詳細については、「 Remove-ManagedFolder」を参照してください。

CreateManagedFolder 要求の例

説明

次の CreateManagedFolder 要求の例は、Test Managed Folder という名前のマネージド フォルダーをメールボックスに追加する方法を示しています。

注:

デリゲート アクセスを使用して、マネージド カスタム フォルダーを追加することもできます。

コード

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Body>
    <CreateManagedFolder xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <FolderNames>
        <t:FolderName>Test Managed Folder</t:FolderName>
      </FolderNames>
    </CreateManagedFolder>
  </soap:Body>
</soap:Envelope>

要求要素

要求では、次の要素が使用されます。

CreateManagedFolder 操作の要求メッセージの他のオプションを見つけるには、スキーマ階層を調べます。 CreateManagedFolder 要素から開始します。

CreateManagedFolder 応答の成功

説明

次のコード例は、CreateManagedFolder 要求に対する正常な応答を示しています。

注:

読みやすさを維持するために 、IdChangeKey の属性値が短縮されました。

コード

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="598" MinorBuildNumber="0" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"/>
  </soap:Header>
  <soap:Body>
    <CreateManagedFolderResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                                 xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
                                 xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:ResponseMessages>
        <m:CreateManagedFolderResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:Folders>
            <t:Folder>
              <t:FolderId Id="AS0AdX=" ChangeKey="AACADA=="/>
            </t:Folder>
          </m:Folders>
        </m:CreateManagedFolderResponseMessage>
      </m:ResponseMessages>
    </CreateManagedFolderResponse>
  </soap:Body>
</soap:Envelope>

成功した応答要素

応答では、次の要素が使用されます。

CreateManagedFolder 操作の応答メッセージの他のオプションを見つけるには、スキーマ階層を調べます。 CreateManagedFolderResponse 要素から開始します。

CreateManagedFolder エラー応答

説明

次のコード例は、CreateManagedFolder 要求に対するエラー応答を示しています。

コード

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="598" MinorBuildNumber="0" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"/>
  </soap:Header>
  <soap:Body>
    <CreateManagedFolderResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                                 xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
                                 xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:ResponseMessages>
        <m:CreateManagedFolderResponseMessage ResponseClass="Error">
          <m:MessageText>A specified managed folder already exists in the mailbox.</m:MessageText>
          <m:ResponseCode>ErrorManagedFolderAlreadyExists</m:ResponseCode>
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
          <m:Folders/>
        </m:CreateManagedFolderResponseMessage>
      </m:ResponseMessages>
    </CreateManagedFolderResponse>
  </soap:Body>
</soap:Envelope>

エラー応答要素

エラー応答では、次の要素が使用されます。

関連項目

GetFolder 操作

FindFolder 操作

フォルダーの検索

管理フォルダーの追加