> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/stifler/features-breakdown/automation-and-scripting.md).

# Automation and Scripting

Once configured with the relevant network and location data, StifleR is designed to run on autopilot and will transparently and automatically manage and adjust bandwidth controls across the enterprise. In cases where there is a need to change settings manually (to expedite certain custom deployments, for example), instant configuration changes can be automated and scripted via PowerShell and the WMI Provider, or can be changed directly through the dashboard GUI interface — all at the client, subnet, site, or enterprise level.

## Automation and efficiency

While the dashboard interface can be used for small-scale manual configuration and control, for serious, enterprise-wide automated administration StifleR can be configured via Microsoft PowerShell or WMIC scripting, which interacts with the StifleR Windows Management Instrumentation (WMI) namespace. There are limitless possibilities in this regard.

We also recommend that you read through the `StifleRServerScriptingGuidance.ps1` script in the StifleR Server installation folder, which contains numerous handy code snippets to help with various administrative tasks.

### Command line execution

Using the command line execution feature, you can easily run commands across many systems at one time.

### PowerShell everywhere!

Identical to command line execution, but with PowerShell scripts on clients instead. Each script is distributed to the client and executed.

### Create your own BITS downloads

StifleR not only monitors BITS downloads, it can create them too. Two suggestions for using this feature are:

* Download the top 10 most-accessed files from your corporate intranet into the BranchCache cache overnight.
* Seed (pre-stage) certain key systems in remote locations with software updates that can then be shared via BranchCache.

### Wake-on-LAN

StifleR has Wake-on-LAN technology built in, which may be used to power on systems in a location that holds cached content needed by peer clients. This saves bandwidth and time, as the transfer becomes peer-to-peer instead of WAN-based.

### Change content delivery priorities

StifleR is designed to enable configuration and control over the static priority of different content types, and allows you to change the priority of a job immediately using WMI. Depending on what you want to achieve, you can change job priority in several different ways:

1. Pause a running higher-priority job in order to allow the next job in line to start. The original job can then be resumed once the other has completed.
2. Make changes centrally to the StifleR download job definition file (`stiflerulez.xml`) and push this to clients instantly via StifleR. For example, one type of BITS job can be updated to a higher priority to get certain content distributed ahead of existing traffic.

Changes to bandwidth and priorities made directly via WMI (or through the Dashboard) replicate to settings within seconds — regardless of how many locations you have targeted.

### Multilane transfer

#### **Intelligent bandwidth sharing between active devices**

StifleR also allows for multilane transfers, i.e. multiple transfers at the same time. Using a combination of locally cached BranchCache content and Data Deduplication, transfers can proceed with none, or very little, traffic on the WAN, as most of the content is actually already present and only the remaining balance of content needs transferring. The following scenario illustrates how this works in the real world:

A client at a remote location starts to download content. At the same time, another peer at that same remote location needs to download and install an updated version of the same content. Because of Windows Data Deduplication, a large percentage of the content does not need to be transferred over the WAN. Instead of waiting for the complete local data to become available, the StifleR client on the second peer will allow the download to go ahead, at the same priority as the existing download but at reduced bandwidth. This allows the peer to slowly download the content, which, thanks to deduplication, may be enough to get the installation started faster, as most of the content will be sourced from local caches with only a trivial amount coming over the WAN.

#### **Summary**

StifleR empowers you to re-prioritize content delivery quickly and non-destructively (without killing jobs). When you change content priorities, any paused content automatically resumes after the new, higher-priority content transfer completes, without retransmitting data already downloaded. You can specify job priority and also allow jobs to run side by side while using appropriate bandwidth in proportion to each job's needs. StifleR also has the ability to monitor and adjust bandwidth usage up or down according to set limits. StifleR makes it easy to view, configure, and manage all content priority changes, and to monitor content transfer in real time.

#### Pause and resume

An important function utilized by StifleR, which should already be functioning in your software distribution solution, is automatic pause and resume. This is the control that lets you move something to the top of the queue, causing the currently active item to pause immediately. Later, when the urgent content finishes downloading, BITS will resume the interrupted download exactly where it left off, without missing a byte and without re-transmitting data already downloaded. The healthy state of this function in the enterprise should be considered a prerequisite for StifleR operation.

#### Stop and resume

In some exceptional circumstances, you may need to completely stop traffic from transmitting over the WAN.

Stopping every BITS job in the entire enterprise is as easy as a single WMI command line:

```
-ArgumentList "Suspend", False, "*", 0, "ALL"
```

<figure><img src="https://425521159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1rrK0lTrlpunspNbITJB%2Fuploads%2FbpwxeN0tRz3b9sURHCiw%2Fimage.png?alt=media&amp;token=495a71b2-ff98-4820-b9ad-106912901419" alt=""><figcaption><p>Suspending all BITS jobs in the enterprise</p></figcaption></figure>

StifleR uses the default BITS API commands, so an administrator can just as easily suspend, resume, cancel, or complete jobs.

By changing the argument list around a little, you can do some powerful things. If we change "ALL" to an IP Network ID, we can target resources in a more granular manner:

```
-ArgumentList "Suspend", False, "*", 0, "192.168.137.0"
```

<figure><img src="https://425521159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1rrK0lTrlpunspNbITJB%2Fuploads%2FKDZSEvMuZnSjsjiUIbO0%2Fimage.png?alt=media&amp;token=e1b6ffc4-0b87-4c37-a202-0ccb62402099" alt=""><figcaption><p>Instantly pausing all content transfers going into a specific subnet with a single command</p></figcaption></figure>

If true pause/resume is important to your organization, it's worth understanding why this is unique. You can instantly pause content transfer non-destructively (without killing jobs) anywhere in your enterprise, and later resume exactly where it left off. There is no limit to the scope:

* For delivery of a single piece of content.
* For all content delivery to a single location or subnet.
* For all content delivery globally.

By using PowerShell or any other WMI-aware scripting language, you can easily pipe objects to each other. For example, you can select a location where bandwidth usage is too high and then suspend all jobs temporarily as required. Refer to the scripting guide mentioned above for further examples and ideas.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/stifler/features-breakdown/automation-and-scripting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
