Ytria logo TUTORIALS

This website require JavaScript for full functionality. Please enable JavaScript in your Web browser.


 

Before you begin:

This script is part of a series designed to help you understand your IBM Notes and Domino environment for consolidation, be it for an imminent migration or for routine maintenance.
If you want to learn more about how Ytria's automation scripts function, see our automation basics help page.

For single databases:

Step 1 Copy/paste the script below into any text editor, and save your file in XML format.
Step 2 Open scanEZ and select the 'Database > Load Automation File' option.
Step 3 Find and select the XML file you just saved, and then click 'Open.'

For multiple databases:

Step 1 Copy/paste the script below into any text editor, change your values as needed, and save your file in XML format.
Step 2 Open databaseEZ and load your server.
Step 3 Select the databases you want to scan for profiles documents, right-click and select the option 'Execute Automation File on...' from the context menu, choose scanEZ from the list, select the servers you want to analyze, and then click 'OK'.
Step 4 Finally, find and select the XML file you just saved, and then click 'Open.'

Here is the script:

<ytriaAutomation Application="scanEZ" ApplicationVersion="16.5">

<!--This will set the script's behavior when encountering an error. In this case, it will continue.-->
<onerror continue="true" />
<!--Use the following variables to adapt the script to your own needs.-->
<!--TO SET :: this is THE FORMULA that will be used. Note that the formula follows the general XML rules of "escaping". -->
<SetVar vSearchFormula="SELECT Form=&quot;Mailrule&quot;&amp;Enable=&quot;1&quot;"/>
<!--TO SET :: This is the item to use as a main "key" for the report.-->
<SetVar vItemToUseAsKey="ActionList"/>
<!--This script block will perform the search for the documents using the formula set earlier. Any documents found will be added-->
<!--to a new My Selection folder titled "All Enabled Mailrules and the database name will be set as the displayed selection tree title.-->
<SearchBy Type="Formula">
<Setparam Field="SetFormula" Value="{%vSearchFormula%}"/>
<Setparam Field="SearchDocuments" Value="true"/>
<Setparam Field="SearchDesigns" Value="false"/>
<Setparam Field="PutSearchInSelCreateName" Value="All Enabled Mailrules"/>
<Setparam Field="TitleOptionType" Value="Formula"/>
<Setparam Field="TitleOptionFormula" Value="@Implode(@DbName;&quot;!!&quot;)"/>
</SearchBy>

<!--The following Focus line will place the focus on the newly created My Selection folder named "All Docs Found".-->
<Focus Target="Tree" Category="All Enabled Mailrules"/>

<!--The following If condition declares that If the My Selection exists (i.e. something has been found),
the nested child actions will be carried out.-->
<if Target="Tree" Test="FocusRoot" Mode="NotEquals" Value="True">

<!--This opens the Values grid and immediately adds a column to display the value of the item
set in the key variable: "ActionList"..-->
<Values>
<SetParam Field="AddItem" Value="{%vItemToUseAsKey%}"/>
<!-- This will remove the Type column within the Values grid (for a more concise look).-->
<ShowTypeColumns value="false"/>

<!-- And this adds a custom column where the UNID will be displayed.-->
<AddCustomColumn name="UNID">
<SetParam field="TitleOptionType" Value="System"/>
<SetParam field="TitleOptionSystem" Value="UNID"/>
</AddCustomColumn>
<Evaluate/>

<!--Finally, the results of the search will be exported into a report titled report_DeleteDoc.xlsx.
If this script is to be executed as part of a Loop/List, the newly found information will be
exported and appended to the same file.-->
<Export>
<SetParam field="FilePath" value="report_Mailrules.xlsx"/>
<SetParam field="SelectedRowsOnly" value="false"/>
<SetParam field="ExportType" value="Excel"/>
<SetParam field="Mode" value="AppendRows"/>
<SetParam field="ExcelSheetName" value="MAILRULES FOUND"/>
<SetParam field="OpenFileOnceGenerated" value="False"/>
</Export>
</Values>
</if>
</ytriaAutomation>

<ytriaAutomation Application="scanEZ" ApplicationVersion="16.5">

<!--This will set the script's behavior when encountering an error. In this case, it will continue.-->
<onerror continue="true" />
<!--Use the following variables to adapt the script to your own needs.-->
<!--TO SET :: this is THE FORMULA that will be used. Note that the formula follows the general XML rules of "escaping". -->
<SetVar vSearchFormula="SELECT Form=&quot;Mailrule&quot;&amp;Enable=&quot;1&quot;"/>
<!--TO SET :: This is the item to use as a main "key" for the report.-->
<SetVar vItemToUseAsKey="ActionList"/>
<!--This script block will perform the search for the documents using the formula set earlier. Any documents found will be added-->

      <!--to a new My Selection folder titled "All Enabled Mailrules and the database name will be set as the displayed selection tree title.-->
<SearchBy Type="Formula">
<Setparam Field="SetFormula" Value="{%vSearchFormula%}"/>
<Setparam Field="SearchDocuments" Value="true"/>
<Setparam Field="SearchDesigns" Value="false"/>
<Setparam Field="PutSearchInSelCreateName" Value="All Enabled Mailrules"/>
          <Setparam Field="TitleOptionType" Value="Formula"/>
          <Setparam Field="TitleOptionFormula" Value="@Implode(@DbName;&quot;!!&quot;)"/>
</SearchBy>

<!--The following Focus line will place the focus on the newly created My Selection folder named "All Docs Found".-->
<Focus Target="Tree" Category="All Enabled Mailrules"/>

<!--The following If condition declares that If the My Selection exists (i.e. something has been found),
the nested child actions will be carried out.-->
<if Target="Tree" Test="FocusRoot" Mode="NotEquals" Value="True">

<!--This opens the Values grid and immediately adds a column to display the value of the item
            set in the key variable: "ActionList"..-->
<Values>
<SetParam Field="AddItem" Value="{%vItemToUseAsKey%}"/>
<!-- This will remove the Type column within the Values grid (for a more concise look).-->
<ShowTypeColumns value="false"/>

<!-- And this adds a custom column where the UNID will be displayed.-->
<AddCustomColumn name="UNID">
<SetParam field="TitleOptionType" Value="System"/>
<SetParam field="TitleOptionSystem" Value="UNID"/>
</AddCustomColumn>
<Evaluate/>

<!--Finally, the results of the search will be exported into a report titled report_DeleteDoc.xlsx.
If this script is to be executed as part of a Loop/List, the newly found information will be
exported and appended to the same file.-->
<Export>
<SetParam field="FilePath" value="report_Mailrules.xlsx"/>
<SetParam field="SelectedRowsOnly" value="false"/>
<SetParam field="ExportType" value="Excel"/>
<SetParam field="Mode" value="AppendRows"/>
<SetParam field="ExcelSheetName" value="MAILRULES FOUND"/>
<SetParam field="OpenFileOnceGenerated" value="False"/>
</Export>
</Values>
</if>
</ytriaAutomation>