Contents
-
Introducing Tachyon
-
Quick Start
-
Implementing Tachyon
-
Using Settings
-
Using Explorer
-
Using Guaranteed State
-
Using Inventory
-
Using Experience
-
Using Patch Success
-
Troubleshooting
-
Extending Tachyon
-
Training
-
Tachyon Operator v5.0 Lab Guide
-
Tachyon Advanced v5.0 Lab Guide
-
Ex 1 - TCN Adv 5.0 - TIMS Explained
-
Ex 2 - TCN Adv 5.0 - TIMS Functions
-
Ex 3 - TCN Adv 5.0 - SCALE The Relational Model
-
Ex 4 - TCN Adv 5.0 - Creating an Instruction: Critical Services
-
Ex 5 - TCN Adv 5.0 - Creating an Instruction that executes a Script
-
Ex 6 - TCN Adv 5.0 - Visualization and Aggregation
-
Ex 7 - TCN Adv 5.0 - Extending Guaranteed State
-
Ex 8 - TCN Adv 5.0 - Real World Examples for Guaranteed State
-
Ex 9 - TCN Adv 5.0 - Tachyon Activity Record
-
Ex 1 - TCN Adv 5.0 - TIMS Explained
-
Tachyon - Nomad as Content Provider Lab Guide
-
Tachyon Operator v5.0 Lab Guide
-
Reference
Creating an Instruction that executes a Script
Now that we have created two complex Instructions using the native language, we will create an Instruction using a PowerShell (PS) script. There may be instances where you might not be able to accomplish your end goal using just the native language. Or you might already have a script that uses complex logic to return information you are looking for or execute an action you want on your endpoints. In these cases, you can create an Instruction which employs a PS script.
Create an Instruction
In this task, we will create a query that identifies what the ConfigMgr assigned Site code is for our clients.
Create a Query
- In TIMS, go to File and select New to clear the existing instruction definition
- In the query window, copy in the following query
- Click the Run button
- Note the value that returns. This is the site code for the CM site in our lab environment
- In the Instruction Definition pane on the top right, input the following for Description and ReadablePayload
- Name the Instruction 1ETRN-Check SCCM Site
- Click the Schema button in the top ribbon and validate the suggested schema. Click OK
- From the menu, click File->Save as. Click OK on the Validation page
- Save the instruction as CheckSCCMSite.XML under C:\Tools
NativeServices.RunWmiQuery(Namespace:"root\\ccm", Query:"SELECT name from sms_authority");
Creating an Action Instruction that Contains a Script
In this task, we will create an action Instruction that changes the CM site code on the Tachyon clients. We will accomplish this using a PowerShell script.
- Navigate to \\1ETRNAP\Temp and copy setSCCMSite.ps1 to c:\tools when that finishes right click the setSCCMsite.ps1 file
- Edit with Notepad and review the syntax of the file
- In the TIMS console menu, click on File and select New. Click OK
- From the ribbon along the top, select Import resource
- Browse to C:\Tools and select the setSCCMsite.ps1 file
- In the Instruction Resource popup, review the settings and click OK
- Click Add parameter from the top ribbon and input SCCMSite into the name
- In the Max Length box, input 3. Click OK
- In the Middle pane, click the down arrow for the Resources next to the file name setSCCMsite and select Insert snippet to download
- On the line beneath the file download syntax, paste in the following
- In the Instruction Definition pane on the top right, input something into Description
- Name the Instruction 1ETRN-Set SCCM Site Code
- Change the InstructionType to Action using the dropdown menu
- In the ReadablePayload field, input the following: Change the SCCM Site code to %SCCMSite%
- From the ribbon click on Schema
- In the Edit Schema page, click the green+button. In the Column Name input ExitCode and change Data Type to int32
- Click the green+button again and in the Column Name input Output and leave the Data Type as String. Click OK
- Click the Workflow button in the top ribbon. From the dropdown, select No user approval. Click OK
- Click the Run button from the top ribbon. Input a 3 character value into the Parameters field
- Validate the results
- From the menu, click File-> Save as. Click OK on the Validation page
- Save the instruction as SETSCCMSite.XML under C:\Tools
Scripting.Run(Language:"PowerShell",ExecutionPolicy:"Override",Script:@resource1,InterpretAsJson:False,"%SCCMSite%");
Upload Instructions to Tachyon
Now that we have two instructions, a question and an action, we are ready to upload them to Tachyon as a Product Pack.
- Browse to C:\Tools and multiselect the CheckSCCMSIte.XML and SETSCCMSIte.XML files
- Right click on the selected files and select Send to> Compressed (zipped) folder
- Name the zip file SCCMSite.zip and Copy from C:\Tools to the Config Mgr Source folder using the desktop shortcut
- Copy the SCCMSite.zip from Config Mgr Source to C:\Temp.
- In the browser, if the Tachyon Settings application is not already running, navigate to HTTPS:\\Tachyon.1ETRN.local\Tachyon and navigate to Instructions - Instruction Sets
- Click the Upload button at the top right and browse out to C:\Temp. Select the SCCMSite.zip file and click Open
- Validate that the file was uploaded with no errors
- Select the two instructions uploaded via the Product Pack named What is the SCCM Site code? and Change the SCCM Site code to <SCCMSite>
- Click Move and move the Instructions into the 1ETRN Instruction Set
Running Instructions
Now that we've created Instructions and added them to Tachyon, we are ready to validate that the instructions execute exactly what we defined within them, and output the appropriate information when run.
- Navigate to the home page of Tachyon Explorer
- In the I want to know box, type in What is the SCCM Site code
- Click Ask this question
- Wait for all clients to respond. Note the Results return in the form of Device Name and Name for the SCCM Site code, and the value is in the form of SMS:xxx (Remember 1 will be the value you changed it to in Step 362)
- The Site code for the SCCM site in our lab environment is PS1. Keep note of this as we change the site code.
- Once all results are in, click on the Actions tab
- Type in Change the SCCM Site code
- Input AAA into the site code parameter box and click Perform this action
- Note the results. There will be 3 columns, Device Name, Exit Code and New SCCM Site
- From the Start menu, click on Control Panel. Under the Control Panel, click on the Configuration Manager applet
- Navigate to the Site tab and validate the Site code
- The site code should now be set to the 3 character value you inputted into the Instruction.
Lab Summary
In this lab, we created an Instruction using a PowerShell script. Everything about the Instruction is the same, in terms of defining the schema and all the other values of the Instruction. The difference is that instead of using the SCALE language to develop the Instruction, we are employing a PS script to do the work for us.
Next Page
Ex 6 - TCN Adv 5.0 - Visualization and Aggregation