Search

GlobalSCAPE Knowledge Base

Export a list of IP addresses on EFT to a file

Karla Marsh
EFT

THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • EFT, version 7 and later

QUESTION

Can I export a list of all of the IP addresses available on EFT?

ANSWER

Yes. Using an Advanced Workflow Engine (AWE) task with a script action, you can export a list of the IP addresses on EFT to a file.

MORE INFORMATION

An example of such an AWE task is copied below.

To import the workflow

  1. Paste the code below into a text file.
  2. Save the file named with the Site name, an underscore, and then the task a name, such as"MySite_GetCurrentIPAddressCSV" with the extension of .aml.
  3. Import the file into AWE using the Import button, as described in "Importing Workflows" in the help documentation.
    After you import the workflow, it will appear in the Advanced Workflows node of the tree.
  4. Create an Event Rule, such as a Timer rule, and add the Execute Advanced Workflow Action.
  5. Click the Advanced Workflow Action in the Rule Builder. The Advanced Workflow dialog box appears.
  6. In the Advanced Workflow dialog box of the Event Rule, select the new AWE task to add it to the Event Rule.
    The Event Rule will look similar to the one below (which, in this example, is in an active-active cluster). You can then add follow-on actions, such as an email notification.
    Note that if you are creating this rule for an HA environment, you must define the node the rule is to run on, and a backup default node.

Copy and paste the code below into a TXT file, then save it with an AML extension and import it into EFT.
<AMTASK>
<AMTASKHEAD>
    <TASKINFO TASKVERSION="8090" />
</AMTASKHEAD>
<AMFUNCTION NAME="Main" RETURNTYPE="variable">
<!-- Collect a list of IPs and create a CSV list -->
<AMSCRIPT>Function GetCurrentIPAddressCSV As String
    strComputer = &quot;.&quot;
    Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
    Set ipConfigSet = objWMIService.ExecQuery (&quot;SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled='True'&quot;)
    ipCSVString = Null
    For Each ipConfig In ipConfigSet
        If Not IsNull(ipConfig.IPAddress) Then
            For i = LBound(ipConfig.IPAddress) To UBound(ipConfig.IPAddress)
                If Not InStr(ipConfig.IPAddress(i), &quot;:&quot;) &gt; 0 Then
                    If Not IsNull(ipCSVString) Then
                        ipCSVString = ipCSVString &amp; &quot;,&quot; &amp;  ipConfig.IPAddress(i)
                    Else
                        ipCSVString = ipConfig.IPAddress(i)
                    End If
                End If
            Next
        End If
    Next
    GetCurrentIPAddressCSV = ipCSVString
End Function
'Sub Main
'    returnVal = GetCurrentIPAddress()
'End Sub
</AMSCRIPT>
<AMVARIABLE NAME="ipAddressCSVList">%GetCurrentIPAddressCSV()%</AMVARIABLE>
<AMFILEWRITE FILE="C:\temp\IPList.csv">%ipAddressCSVList%</AMFILEWRITE>
</AMFUNCTION>
</AMTASK>

In the line that defines the location and name of file to write to, "<AMFILEWRITE FILE" you can save it to any location and name it whatever you want, as long as EFT can write there.

Details
Last Modified: 8 Months Ago
Last Modified By: kmarsh
Type: HOWTO
Rated 2 stars based on 2 votes.
Article has been viewed 18K times.
Options
Also In This Category
Tags