Contents
-
Writing Tachyon Instructions
-
Getting started with TIMS
-
Installing TIMS
-
Running instructions in Tachyon for the first time
-
Instruction Definition Reference
-
SCALE User Guide
-
Functions and Methods Reference
-
Tachyon Agent Methods
-
Agent.CheckForUpdates
-
Agent.Echo
-
Agent.GetConnectionInformation
-
Agent.GetDiagnostics
-
Agent.GetExtensibility
-
Agent.GetInstructionStatistics
-
Agent.GetKeyFiles
-
Agent.GetSummary
-
Agent.Log
-
Agent.Sleep
-
Agent.Stagger
-
ContentDistribution.Stage
-
ContentDistribution.StageAndExecute
-
Device.GetCriticality
-
Device.GetDisks
-
Device.GetInboundMappedDriveHistory
-
Device.GetInboundPrinters
-
Device.GetLocation
-
Device.GetOutboundMappedDriveHistory
-
Device.GetOutboundPrinters
-
Device.GetProcessors
-
Device.GetSummary
-
Device.SetCriticality
-
Device.SetLocation
-
Discovery.LookupNetBiosNames
-
Discovery.ScanPortsOnDevices
-
Discovery.SendArpRequest
-
FileContent.AppendText
-
FileContent.FindAndAppend
-
FileContent.FindAndDelete
-
FileContent.FindAndReplace
-
FileContent.GetTorrentAnnounceUris (deprecated)
-
FileContent.GetTorrentDescribedFiles (deprecated)
-
FileContent.GetTorrentInfo (deprecated)
-
FileContent.WriteText
-
FileSystem.CreateTempFile
-
FileSystem.DeleteFileByName
-
FileSystem.FindDirectoryByName
-
FileSystem.FindFileByName
-
FileSystem.FindFileBySizeAndHash
-
FileSystem.GetDigitalSignature
-
FileSystem.GetDirectoryHash
-
FileSystem.GetFile
-
FileSystem.GetFileByLine
-
FileSystem.GetFileDetails
-
FileSystem.GetFileHash
-
FileSystem.GetFilePermissions
-
FileSystem.GetFilesInDirectory
-
FileSystem.GetFilesInFolder (deprecated)
-
FileSystem.GetHash (deprecated)
-
FileSystem.GetVersionInfo
-
FileSystem.PathExists
-
Http.Post
-
Interaction.GetActiveResponses
-
Interaction.GetInteractionState
-
Interaction.GetResponseHistory
-
Interaction.GetSessions
-
Interaction.GetWindows
-
Interaction.InvalidateResponse
-
Interaction.SetDoNotDisturb
-
Interaction.ShowAnnouncement
-
Interaction.ShowNotification
-
Interaction.ShowQuestion
-
Interaction.ShowSurvey
-
Inventory.GetTables
-
Method Notes
-
Mobile.GetEmailAddress
-
Mobile.GetEncryptionStatus
-
Mobile.GetLocation
-
Mobile.GetMobileSummary
-
Mobile.GetPasswordQuality
-
Mobile.IsGPSEnabled
-
Mobile.IsPrintingSupported
-
NativeServices.GetWmiNames
-
NativeServices.RegistryDeleteKey
-
NativeServices.RegistryDeleteUserKey
-
NativeServices.RegistryDeleteUserValues
-
NativeServices.RegistryDeleteValue
-
NativeServices.RegistryEnumerateKeys
-
NativeServices.RegistryEnumerateUserKeys
-
NativeServices.RegistryEnumerateUserValues
-
NativeServices.RegistryEnumerateValues
-
NativeServices.RegistryGetUserValues
-
NativeServices.RegistryGetValue
-
NativeServices.RegistryKeyExists
-
NativeServices.RegistrySetUserValues
-
NativeServices.RegistrySetValue
-
NativeServices.RegistryUserKeyExists
-
NativeServices.RegistryUserValueExists
-
NativeServices.RegistryValueExists
-
NativeServices.RunCommand
-
NativeServices.RunWmiInstanceMethod
-
NativeServices.RunWmiQuery
-
NativeServices.RunWmiStaticMethod
-
Network.GetArpEntries
-
Network.GetConnections
-
Network.GetDnsEntriesByAddress
-
Network.GetIpAddress (deprecated)
-
Network.GetIpAddresses
-
Network.GetListeningEndpoints
-
Network.GetNetworkSummary
-
Network.GetWiFiNetworks
-
Network.SetAirplaneMode
-
Network.SetBlueToothMode
-
Network.SetWiFiMode
-
Nomad.CachedPkgStatus
-
Nomad.FindBestPkgCache
-
Nomad.GetCachedPkgDetails
-
Nomad.GetCmContentLocations
-
Nomad.GetVariable
-
Nomad.JobsStatus
-
Nomad.Pause
-
Nomad.PauseJobQueue
-
Nomad.Resume
-
Nomad.ResumeJobQueue
-
Nomad.RunPkgStatusRequest
-
Nomad.RunSsdQuery
-
Nomad.Status
-
Nomad.Stop
-
OperatingSystem.ControlService
-
OperatingSystem.GetInstalledUpdates
-
OperatingSystem.GetProcesses
-
OperatingSystem.GetRunningApps
-
OperatingSystem.GetServiceInfo
-
OperatingSystem.GetSummary
-
OperatingSystem.GetUpdatesPendingReboot
-
OperatingSystem.GetUpdateSummary
-
OperatingSystem.KillProcess
-
OperatingSystem.KillProcesses
-
Patch.Deploy
-
Patch.GetStatus
-
Patch.List
-
Patch.TestConnection
-
Policy.ForceStatusReport
-
Policy.GetEventSubscriptions
-
Policy.GetRuleEvaluationHistory
-
Policy.GetRules
-
Policy.GetStatistics
-
Policy.GetSummary
-
Policy.Invalidate
-
Scripting.Run
-
Scripting.RunText
-
Security.CheckSimpleIoc (deprecated)
-
Security.DeleteCertificates
-
Security.GetCertificates
-
Security.GetQuarantineStatus
-
Security.ModifyQuarantineWhitelist
-
Security.QuarantineDevice
-
Security.UnquarantineDevice
-
Software.GetInstallations
-
Software.GetUserInstallations
-
Software.Uninstall
-
Storage.Check
-
Storage.Delete
-
Storage.Get
-
Storage.GetRemote
-
Storage.List
-
Storage.Set
-
Tagging.Check
-
Tagging.Clear
-
Tagging.Count
-
Tagging.Delete
-
Tagging.Get
-
Tagging.GetAll
-
Tagging.Set
-
Users.FindLocalGroupMember
-
Users.GetInboundConnectionHistory
-
Users.GetLocalGroupMembers
-
Users.GetLoggedOnUsers
-
Users.GetOutboundConnectionHistory
-
Users.GetPrimaryUser
-
Utilities.GenerateSequence
-
Utilities.JsonFromTable
-
Utilities.SplitLines
-
Utilities.TableFromJson
-
Agent.CheckForUpdates
-
Tachyon Agent Built-in Functions
-
Tachyon Agent Built-in Keywords
-
Tachyon Agent SQL Functions
-
Tachyon Agent Methods
-
Custom Response Visualizations
-
Training Lab Guide - Advanced
-
Getting started with TIMS
-
Integrating with Tachyon
-
Tachyon .NET Consumer SDK
-
Tachyon PowerShell Toolkit
-
Index
Method | RunCommand | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Module | NativeServices | |||||||||||||
Library | Core | |||||||||||||
Action | Execute a command-line. | |||||||||||||
Parameters |
| |||||||||||||
WorkingDirectory (string; optional): The path of the current directory when the command is executed. | ||||||||||||||
SplitLines (boolean; optional, default false ): Whether or not to return a row per line of output. Cannot be used with InterpretAsJson . | ||||||||||||||
| ||||||||||||||
Case is not significant. From v5.1. This parameter is implemented for Windows only; it is allowed but ignored for other platforms, apart from Android where it must not be given. | ||||||||||||||
InterpretAsJson (boolean; optional, default false ): If specified and has value true , assume that the output of the command is JSON and deserialize it. The return value is then the table produced. Cannot be used with SplitLines . | ||||||||||||||
Timeout is not supported on Android. It is not an error to specify the parameter but the value will be ignored. | ||||||||||||||
Try to avoid using TimeoutKill if possible, and instead let the sub-process die in its own time. For example, consider the effect of killing an install partway through. | ||||||||||||||
| ||||||||||||||
If this parameter is absent the command will be executed in the Tachyon Agent process's user context. It is not an error if the specified user is not currently logged on (and this includes accounts that are not even defined). In this case execution is deemed successful but the method does nothing and returns no data. The specified user must be currently logged on and running explorer.exe (Windows Explorer). | ||||||||||||||
Return values |
Many Windows programs set a zero exit code even on failure.
If there is no (captured) output from the program whatsoever, the return value from this method is completely empty. There is not a single row with an empty Output value, as might be expected. | |||||||||||||
Examples | Running as the Tachyon.Agent user (LocalSystem usually) NativeServices.RunCommand(CommandLine:"ping 127.0.0.1", SplitLines:true, IgnoreExitCode:true); NativeServices.RunCommand(CommandLine:@cmdRun, SplitLines:true, WorkingDirectory:@fileDir, TimeoutSecs: 10, TimeoutKill: true); AsUser example @users = Users.GetLoggedOnUsers(); @users = select * from @users where SessionState='Active'; NativeServices.RunCommand(CommandLine:"c:\\windows\\notepad.exe", AsUser:@users.Account); | |||||||||||||
Platforms |
| |||||||||||||
Notes | If the Agent is shut down while a command is running (with or without a timeout specified), the command subprocess is detached from the Agent (so that Agent shutdown is not blocked), and the Tachyon instruction's status is set to "execution failed" because Tachyon cannot know the ultimate fate of the command. It is up to the user to decide whether to resubmit the instruction or not when the Tachyon Agent resumes. By default, a long-running instruction will time out. "Long running" is 3600 seconds, i.e. 1 hour. This is to prevent a hanging command from completely blocking the Tachyon Agent, because the Agent has an exclusivity feature for safety such that even if the Agent runs with multiple workers then executing a command prevents any other worker from running an instruction in parallel. (This is because instructions that follow the command might depend on that command having run to completion.) A command hanging indefinitely would completely block the Agent, including any instructions to kill the hanging command's process. If a command really must be run to completion, set Because the Tachyon Agent has multiple workers and so can run a number of instructions in parallel, it is possible that conflicting commands could run at the same time, e.g. each attempting to install software. (Software packages can only usually be installed one at a time.) If this is likely to be a problem, the Agent's " |