TEWS SOAP Sample: How to create Account Template using "copy of" option

Document ID : KB000017943
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This is demonstration sample TEWS soap xml showing Create Account template as "copy of" an existing one.

Solution:

Here is an XML sample of Soap Request for TEWS:


 	<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://tews6/wsdl">
     <soapenv:Header/>
     <soapenv:Body>

   <wsdl:TaskContext>
    <wsdl:admin_id>superadmin</wsdl:admin_id>
    <wsdl:admin_password>secret</wsdl:admin_password>
   </wsdl:TaskContext>	
   
   <wsdl:CreateActiveDirectoryAccountTemplate>
     <wsdl:CreateActiveDirectoryAccountTemplateSearch>
      <wsdl:CreateCopy>true</wsdl:CreateCopy>
      
<wsdl:Subject>
<wsdl:UniqueName>Policy=MyADSAccountPolicy,Namespace=ActiveDirectory,Domain=MyIMDomain,     
 Server=Server</wsdl:UniqueName>
</wsdl:Subject>

</wsdl:CreateActiveDirectoryAccountTemplateSearch>

<wsdl:CreateActiveDirectoryAccountTemplateActiveDirectoryAccountTemplateAccountTemplateTab>
<wsdl:_PCT_ACCOUNT_TEMPLATE_NAME_PCT_> MyNewADSAccountPolicy </wsdl:_PCT_ACCOUNT_TEMPLATE_NAME_PCT_>
</wsdl:CreateActiveDirectoryAccountTemplateActiveDirectoryAccountTemplateAccountTemplateTab>
</wsdl:CreateActiveDirectoryAccountTemplate>

</soapenv:Body>
</soapenv:Envelope> 

In this sample; You need to change the following values by yours:

"MyADSAccountPolicy" is your original account template name you want to copy.
"MyIMDomain" is your IM domain name.
"MyNewADSAccountPolicy" is your account template you want to create.