...
- Import Module
PS C:\> Import-Module JobScheduler
- loads the module from a location that is available with the PowerShell module path,
- see
$env:PSModulePath
for predefined module locations.
PS C:\> Import-Module C:\some_module_location\JobScheduler
- loads the module from a specific location, absolute and relative paths can be used.
- Hints
- The JCLI module will automatically connect to a Master on import of the module if one of the following environment variables is present:
SCHEDULER_URL
specifies the URL for which the Master is operated.SCHEDULER_ID
specifies the unique identification of a Master.SCHEDULER_HOME
specifies the installation path of a locally available Master.
- You can add the command
Import-Module JobScheduler
to your PowerShell profile to have the module loaded on start of a PowerShell session, see PowerShell CLI - Use Cases - Credentials Management
- The JCLI module will automatically connect to a Master on import of the module if one of the following environment variables is present:
- Use JobScheduler Master Instance
- As a first operation after importing the module it is required to execute the
Use-JobSchedulerMaster
cmdlet orUse-JobSchedulerWebService
(starting from release 1.11) cmdlets. PS C:\> Use-JobSchedulerMaster <Url>
orPS C:\> Use-JobSchedulerMaster -Url <Url> <Url>
orPS C:\> Use-JobSchedulerWebService -Url
<Url>
-Id
<JobSchedulerId>
- specifies the URL for which the JobScheduler Master or REST Web Service is available. This is the same URL that you would use when opening the JOC GUI in your browser, e.g.
http://localhost:4444
. If you omit the protocol (HTTP/HTTPS) for the URL then HTTP will be used. - allows to execute cmdlets for the specified Master independently from the server and operating system that the JobScheduler Master is operated for, i.e. you can use PowerShell cmdlets to manage a JobScheduler Master running on a Linux box. As an exception to this rule you cannot start a remote JobScheduler Master and you cannot start a remote JobScheduler Windows service, however, you can restart, terminate, abort and suspend any JobScheduler Master on any platform.
- specifying the URL is not sufficient to manage the Windows Service of the respective Master, see below.
- specifies the URL for which the JobScheduler Master or REST Web Service is available. This is the same URL that you would use when opening the JOC GUI in your browser, e.g.
PS C:\>
PS C:\> Use-JobSchedulerMaster -Id <JobSchedulerID>
- references the JobScheduler ID that has been assigned during installation of a Master.
- adds the JobScheduler ID to the assumed installation base path.
- A typical base bath would be
C:\Program Files\sos-berlin.com\jobscheduler
- The path is added the subdirectory with the value of the JobScheduler ID
- A typical base bath would be
PS C:\> Use-JobSchedulerMaster -InstallPath <InstallationPath>
- specifies the full installation path, e.g.
C:\Program Files\sos-berlin.com\jobscheduler\scheduler1.10
, for a locally available JobScheduler Master.
- specifies the full installation path, e.g.
PS C:\> Use-JobSchedulerMaster -InstallPath $env:SCHEDULER_HOME
- You can use the environment variable
SCHEDULER_HOME
that points to the installation path. - The JobScheduler CLI module on import checks availability of this environment variable.
- You can use the environment variable
PS C:\> Use-JobSchedulerMaster -Url <Url> -Id <JobSchedulerID>
- specify both URL and JobScheduler ID (recommended).
- determines if the Master with the specified JobSchedulerID is locally available.
- Hints
- If your JobScheduler Master is configured to require HTTP authentication then please consider that
- by default the Windows credentials of the current user are forwarded for web requests.
- individual credentials can be added by use of the following cmdlet
Set-JobSchedulerCredentials
. - For details and examples see PowerShell CLI - Use Cases - Credentials Management
- If your JobScheduler Master is configured to require HTTP authentication then please consider that
- As a first operation after importing the module it is required to execute the
- Manage JobScheduler Objects
PS C:\> Show-JobSchedulerStatus
- shows the summary information for a JobScheduler Master
PS C:\> Get-JobSchedulerOrder
PS C:\> Get-JobSchedulerJobChain
PS C:\> Get-JobSchedulerJob
PS C:\> Get-JobSchedulerTask
- retrieves the list of avaiable objects
- see the complete list of cmdlets with the cmdlet:
Get-Command -Module JobScheduler
...
- Makes the JobScheduler Master with the specified URL available for use with cmdlets.
PS C:\> Use-JobSchedulerMaster http://localhost:4444
- Makes the JobScheduler Master with JobScheduler ID
scheduler111
available for use with cmdlets that are executed via the REST Web Services from the specified URL.PS C:\> Use-JobSchedulerWebService http://localhost:4446 -ID scheduler111
- Shows the summary information of a JobScheduler Master.
PS C:\> Show-JobSchedulerStatus
- Shows the number of tasks that are currently running.
PS C:\> (Get-JobSchedulerTask).count
- Stops all running tasks (emergency stop).
PS C:\> Get-JobSchedulerTask | Stop-JobSchedulerTask
- Collects the list of orders from a directory and stores it in a variable.
PS C:\> $orders = Get-JobSchedulerOrder /sos
...
Get-JobSchedulerCalendar
Get-JobSchedulerInventory
Get-JobSchedulerStatus
Get-JobSchedulerSystemCredentials
Get-JobSchedulerVersion
New-JobSchedulerHolidays
Restart-JobSchedulerMaster
Resume-JobSchedulerMaster
Send-JobSchedulerCommand
Set-JobSchedulerCredentials
Set-JobSchedulerOption
Show-JobSchedulerCalendar
Show-JobSchedulerStatus
Start-JobSchedulerDashboard
Start-JobSchedulerJobEditor
Start-JobSchedulerMaster
Stop-JobSchedulerMaster
Suspend-JobSchedulerMaster
Use-JobSchedulerAlias
Use-JobSchedulerMaster
Use-JobSchedulerWebService
Agent Managment
...