Network Topology Automation

Default Basic Automation

StifleR automatically ‘learns’ about networks as the StifleR clients connect and report data to the server. The Server builds up a list of subnets with a default bandwidth limit set for each new one that is discovered. This information is stored in the StifleR Database file which is stored in the StifleR Server program data folder.

<add key="AutoAddLocations" value="1"/>

Manual Configuration

To manually “pre-configure” the StifleR Network Infrastructure you can load all of your network information into StifleR prior to deploying any clients. This can be achieved via automation through PowerShell/WMI scripting etc,.

Intelligent Automation of Location and Subnet Configuration

As mentioned above, in the default process, when a StifleR Client reports in from a subnet that does not exist, a new subnet is automatically created with default parameters applied.

There is however a much more intelligent method that uses PowerShell scripting to Generate and then Modify settings for these newly discovered locations. This feature is enabled within the StifleR.Service.exe.config file using the following parameters:

NOTE: The default setting for each of these options is disabled (0). Changing this to a value of “1” enables the feature. Location in this context is not referring to a StifleR Enterprise “Location” but rather discovered subnets.

NOTE: Sample Generate and Modify scripts can be found in the installation folder.

Generate New Location with PowerShell

  • Enable key

<add key="GenerateNewLocationsWithPowerShell" value="0"/>

  • Default path to the script for PS Generation of Sites

 <add key="PowerShellExtensionLocationCreateScriptPath" value="%PROGRAMDATA%\2Pint Software\StifleR\Server\GenerateLocation.ps1"/>

This first option is the most commonly used, as it allows you to set a default ‘template’ for a new subnet according to your preferences. For instance, the overall default Target Bandwidth for a new location may be 1024Mb/s, and you may want to set this to be higher (or lower).

PowerShell can generate any parameter for a new subnet and logic can be used to determine different settings depending on the incoming criteria (subnet, IP Address Range, Physical Location, Computer Name etc)

If the GenerateNewLocationsWithPowerShell setting is enabled, the script identified in the PowerShellExtensionLocationCreateScriptPath is executed as soon as a Client reports in a new subnet.

A basic script is as follows:

#always get the parameter data from the incoming request param($SessionData) 
#Next, instantiate the boot object, which is what you return back from this PowerShell Session 
$Location = new-object StifleR.Service.LocationItem.RootLocation  
This is an example of the SessionData typically returned to the PowerShell provider;  
#OSBuild;Microsoft Windows NT 6.3.9600.0 
#ConnectedTime;2018-02-18 10:47:22 
#CreatedTime;2015-05-20 14:42:24 
#Connectivity;IPv6NoTraffic, IPv4Internet 
#MSGatewayMAC;04-DA-D2-84-AE-42 ***DONT USE THIS FOR A LOCATION GWMAC*** #Type;Ethernet 

Once this data is returned you can then write some new data back to the new subnet

The new subnet must have a unique GUID

Once you have a way to identify the subnet you can edit configuration options. In the following snippet we set a Target Bandwidth of 4096 and setup the Delivery Optimization policy so that the clients in that subnet will only Peer within that subnet.

$Location.TargetBandwidth = 4096 #sets a default target bandwidth
$Location.DateAdded = [System.DateTime]::Now

$Location.Subnet = $SessionData["networkId"]

$Location.GatewayMAC = $SessionData["GatewayMAC"]

$ = $locationId
#These Delivery Optimization parameters are set
#So that DO will only P2P within this subnet
#This should be changed for multiple subnet sites
#Do NOT set these DO params if you are managing DO via GPO/DHCP/SCCM etc
$Location.DOGroupID = $locationId
$Location.DODownloadMode = 2

Finally, we write the new subnet – job done!

return $Location

Modify New Location with Powershell

  • Enable Key:

<add key="ModifyNewLocationsWithPowerShell" value="0"/>
  • Default path to script for PS modification

<add key="PowerShellExtensionLocationModifyScriptPath" value="%PROGRAMDATA%\2Pint Software\StifleR\Server\ModifyLocation.ps1"/>

This option is similar to the Generate function but allows you to Modify a subnet once is has been created. This enables you to have your Generate script set some defaults for new subnets and then let the Modify script change some further parameters depending on other criteria.

If the ModifyNewLocationsWithPowerShell setting is enabled, the script identified in PowerShellExtensionLocationModifyScriptPath is executed as soon as a new subnet has been created

A basic script is as follows:

#always get the param data from request

#This section sets the variables from the SessionData
$LocationId = $SessionData["Id"]
$LocationSubnet = $SessionData["Subnet"]
$LocationGatewayMAC = $SessionData["GatewayMAC"]
$LocationName = $SessionData["LocationName"]

#Now get and modify the resource
$LocationToModify =

Once we have the new location we can do some lookups, for example examine the IPAddress and set a new target bandwidth based on the Address Range – being in PowerShell land the sky is the limit! Here’s some pseudo code to give you an idea:

If subnet starts with 192 – then target bandwidth should be 10Mb

If subnet starts with 10 – then target bandwidth should be 2Mb

#Finally update the location with the new values
swmi -path $LocationToModify.path -Arguments
@{TargetBandwidth=$NewBandwidth;Description="Modified by PowerShell"}


Once subnets are known to StifleR you can then group local subnets together in Parent/Child relationships to form Locations. You can then use these Locations to control Bandwidth usage for the multiple subnets or VLANs as a single administrative unit. As part of your StifleR infrastructure planning you should gather as much information as you can regarding your geographic locations and associated WAN/LAN configurations, speed etc and then group your subnets into StifleR Locations as required. Please feel free to contact us for recommendations in this regard. This process can be automated as above.

Last updated