Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Depending on the license model customers of a Commercial License are obliged to perform license measurement activities on a regular basis.
  • The cmdlet Get-JobSchedulerInventory is provided that helps  helps to keep track of JobScheduler Master and Agent instances in a network.
    • The JobScheduler Master instances are specified manually by the user.
    • The JobScheduler Agent instances are discovered automatically from the JobScheduler Master instances.

...

Count licenses for a JobScheduler Master instance

The following sample show shows how to wait for completion of an ordercreate inventory information for license counting from a JobScheduler Master and respective Agents:

Code Block
languagepowershell
linenumberstrue
Import-Module JobScheduler

# Write the inventory information to the specified XML output file
Get-JobSchedulerInventory http://localhost:4444 -OutputFile /tmp/inventory.xml
 
# Append the inventory information to the specified XML output file
Get-JobSchedulerInventory http://somehost:4444 -OutputFile /tmp/inventory.xml -Append


# Append the inventory information and return the XML object
$inventory = Get-JobSchedulerInventory http://localhost:4444 -OutputFile /tmp/inventory.xml -Append

...

  • Line 4: The Get-JobSchedulerInventory cmdlet is used for the specified Master and writes the inventory information to the specified output file.
  • Line 7: The Get-JobSchedulerInventory cmdlet is used to append the inventory information for the specified Master to the specified output file.
  • Line 10: The Get-JobSchedulerInventory cmdlet is used to append the inventory information for the specified Master to the specified output file and to return the XML object.

 

The resulting XML output file will look like this:

...

The following sample shows how to use native PowerShell jobs to run create inventory information for license counting from a number of JobScheduler orders in parallel and to wait for completion of all orders. As orders are executed in parallel by JobScheduler it is more effective to use asynchronous native PowerShell jobs than to wait for each native PowerShell job individually as from the above sampleMaster instances:

Code Block
languagepowershell
linenumberstrue
Import-Module JobScheduler

# Write the inventory information for JobScheduler Master instances specified by a CSV input file to the specified XML output file
Get-JobSchedulerInventory -InputFile /tmp/inventory.csv -OutputFile /tmp/inventory.xml
 
# Create a list of JobScheduler Master instances that is piped to the cmdlet and write the inventory information to the specified XML output file
$instances = @( 'http://localhost:4444', 'http://somehost:4444' )
$inventory = $instances | Get-JobSchedulerInventory -OutputFile /tmp/inventory.xml -Append

...

  • Line 4: Makes use of a CSV input file that contains the URLs of the respective JobScheduler Master instances as the first column.
  • Line 7: Creates a hashmap of JobScheduler Master URLs.
  • Line 8: Pipes the hashmap to the Get-JobSchedulerInventory cmdlet and appends the inventory information to the specified XML output file.

 

The CSV input file would could look like this:

Code Block
languagexml
collapsetrue
http://localhost:4444
http://somehost:4444