Using PowerShell Scripts for the 2FA Server

The Configuration Tool CLI creates and downloads PowerShell scripts for the 2FA Server. (For more information, see Understanding the Launch Artifacts.) These scripts offer the following options:

You use the script or scripts on the host where you want to run the 2FA Server container.

Using One Script

Use the following process to use a single PowerShell script to pull images and start the containers.

Stage Description
1.

Copy the pull-and-start-twofactorauth-container.ps1 to the host where you want to run the 2FA Server container.

2. On this same host, start Windows PowerShell ISE as Administrator. For more information about using PowerShell, refer to your Windows PowerShell documentation.
3.

To avoid errors regarding non-digitally signed scripts, run the contents of the script as follows:

  1. Copy the contents from the pull-and-start-twofactorauth-container.ps1 script.

  2. Paste the contents in the PowerShell ISE script pane.

  3. Click the Run Selection icon.

Note: Alternatively, you can set the execution policy to allow all scripts, and then run the script as follows:

& "<drive>:<path_to_script>\pull-and-start-twofactorauth-container.ps1"

For more information about setting the execution policy, refer to your Windows PowerShell documentation.

The 2FA Server image is pulled and the container is started.

Using Two Scripts

Use the following process to use separate pull and start PowerShell scripts.

Stage Description
1.

Copy the following files to the host where you want to run the 2FA Server container:

  • pull-twofactorauth-image.ps1

  • start-twofactorauth-container.ps1

2. On this same host, start Windows PowerShell ISE as Administrator. For more information about using PowerShell, refer to your Windows PowerShell documentation.
3.

Pull the image.

To avoid errors regarding non-digitally signed scripts, run the contents of the pull-twofactorauth-image.ps1 script as follows:

  1. Copy the contents from the pull-twofactorauth-image.ps1 script.

  2. Paste the contents in the PowerShell ISE script pane.

  3. Click the Run Selection icon.

Note: Alternatively, you can set the execution policy to allow all scripts, and then run the script as follows:

& "<drive>:<path_to_script>\pull-twofactorauth-image.ps1"

For more information about setting the execution policy, refer to your Windows PowerShell documentation.

The 2FA Server image is pulled.

4.

Start the container.

To avoid errors regarding non-digitally signed scripts, run the contents of the start-twofactorauth-container.ps1 script as follows:

  1. Copy the contents from the start-twofactorauth-container.ps1 script.

  2. Paste the contents in the PowerShell ISE script pane.

  3. Click the Run Selection icon.

Note: Alternatively, if you set the execution policy to allow all scripts as described in Stage 3, you can run the script as follows:

& "<drive>:<path_to_script>\start-twofactorauth-container.ps1"

The 2FA Server container is started.