Example Single Site script
Sample script that provides two functions to update sites and subnets in the Content Distribution locations table: DeleteAllLocations and AddLocation(). This information can then be retrieved by Nomad at a later stage when implementing the Single Site Download and 1E Nomad PBA task sequence actions features.You can view Nomad Sites in the Nomad Sites page.
The Nomad Sites page is primarily designed to show how the network is being used for content distribution in different locations. It focuses on the volume of content downloaded from peers vs over the WAN, rather than the status of specific Content Titles in a given site. You can see what content is available in a given site by looking at the Content tab for that site.
A Nomad Site corresponds to Nomad Single Site Download (SSD) site. Customers that have implemented SSD and upgrade ActiveEfficiency to the Nomad app and Content Distribution will see their defined SSD locations displayed as Nomad Sites in the app.
Any subnets that are not included in a Nomad SSD Site definition will be represented in a site named Unknown. If no SSD sites have been defined, all subnets will be included in the 'Unknown' site.
Prerequisites
The ExampleSitesAndSubnets.ps1 script is available from the Scripts folder in the NomadBranch download zip. You can download this zip from the 1E Support Portal. Refer to Support Portal.
-
Content Distribution 8.0 or above.
-
PowerShell version 5.0 or above.
Support for Authentication Proxy is deprecated from 1E 24.7 and later. However, you can still use these scripts to generate interactive and non-Interactive tokens:
PostADSitesandSubnets.ps1
ExampleSitesAndSubnets.ps1
- If
-Interactive switch
is specified: The interactive authentication token generation mechanism prompts the user for credentials for their Idp type after entering the PlatformUrl. Once authenticated, the default token is valid for 1 hour, and will not prompt to re-enter their credentials. The script refreshes the existing token for its validity.
- If
-Interactive
switch is not specified: The non-interactive authentication token generation mechanism starts where the user needs to enter details like PlatformUrl, AppId, Principal, and CertThumbprint. Once authenticated, the default token is valid for 1 hour. After the token expires, the script refreshes the existing token for its validity.
Using the example Single Site script
The sample script includes an example of how the script can be used:
-
Clears all current sites and subnet information stored in the ContentDistribution database.
-
Adds the following 3 sites and subnets in the ContentDistribution database.
"HOMER.SIMPSON.Springfield" "192.148.226.0/24"
"HOMER.SIMPSON.Springfield" "192.148.228.0/24"
"MARGE.SIMPSON.Springfield" "192.168.227.0/24"
Before using it in your environment, you must edit the script to replace the example "HOMER" site and subnets with your own list. Over time, you will manually modify the script to reflect your environment.
The example script does not support supernets.
If you prefer to automatically add Sites and subnets by querying AD, then you should consider using Example Active Directory Single Site script instead.
Parameters
The script uses the following parameters:
-
PlatformUrl as a mandatory parameter - you must provide the 1E Platform base URL.
-
Tls12 as an optional switch parameter - include this switch if TLS 1.2 is required to connect to the 1E Platform server.
Refer to Authentication proxy for details about using the Interactive switch.
For example, to run the script on a PowerShell command-line:
.\ExampleSitesandSubnets.ps1 -PlatformUrl https://tachyon.acme.local:443 -Tls12
How it works
The sample script provides the following two functions:
function DeleteAllLocations()
Description: Deletes all rows from the ContentDistribution locations table
Params: none
Return: $result(empty)
function AddLocation()
Description: Adds a new entry into the ContentDistribution locations table
Params: site - [string] containing the site name
subnet - [string] containing the ipv4subnet in CIDR notation
Return: $result - newly created location object of the form # {"Id":"efa19226-266f-4bd0-8a9d-94fa5ac1b773","Site":"HOMER.SIMPSON.Springfield","Subnet":"192.148.226.0/24"}
You must edit this section with your own list of sites and subnets:
# optional will delete all existing entries
DeleteAllLocations
# sample adding 3 locations using the AddLocation function
# duplicate entires will report an error: (409) conflict
AddLocation "HOMER.SIMPSON.Springfield" "192.148.226.0/24"
AddLocation "HOMER.SIMPSON.Springfield" "192.148.228.0/24"
AddLocation "MARGE.SIMPSON.Springfield" "192.168.227.0/24"