Jump to content

Steve G

Hornbill Developer
  • Posts

    748
  • Joined

  • Last visited

  • Days Won

    31

Posts posted by Steve G

  1. We've just released an update to the Windows Management package.

    Version 5 of the package contains the following additional operations that can be performed against your Windows targets:

    • Firewall - Rule Disable
    • Firewall - Rule Enable
    • Firewall - Rule Get
    • Firewall - Rule New
    • Firewall - Rule Remove
    • Firewall - Rule Update

    The package is available to update or install from the Package Library now, and you can find more details about this package on the Hornbill Wiki.

    If you have any questions, or suggestions of additional operations for this package, then please let us know here.

    Thanks,

    Steve

  2. Hi @Izu,

    The UI element to this change has not been released into live as yet (I expect that to happen at some point this week), but this change introduces the ability to take a binary SID attributes (as is stored in the objectSid attribute against objects in Active Directory) and convert this to the human-readable SID that can then be written into your users during an import.

     image.png

    Hope this helps,

    Steve

  3. We've just released a new package to the ITOM Package Library: Endpoint Configuration Manager

    The package contains the following operations that can be performed against your Microsoft Endpoint Configuration Manager (formerly SCCM/ConfMan) sites:

    • Device - Add To Collection
    • Device - Approve
    • Device - Block
    • Device - Get Details
    • Device - Remove
    • Device - Remove From Collection
    • Device - Unblock
    • Invoke Discovery - System
    • Invoke Discovery - User
    • Package - New Deployment
    • Package - Start Deployment
    • Script - Approve
    • Script - Deny
    • Script - Get Details
    • Script - Invoke
    • User - Add Device Affinity
    • User - Remove Device Affinity

    The package is available to install from the Package Library now, and you can find more details about this package on the Hornbill Wiki.

    If you have any questions, or suggestions of additional operations for this package, then please let us know here.

    Thanks,

    Steve

  4. Hi @BillP,

    GET requests to dav/cafs_raw/... do indeed work with API keys, and you're 100% correct that the 401 means that the account that is associated to the API doesn't have access, as only a super user has access to that endpoint... 

    BUT! You can send a GET request to the following to programatically download attachments from requests, as long as the user who is associated to the API key has access to the request:

    https://live.hornbill.com/YOURINSTANCEID/php/attachment.php?application=com.hornbill.servicemanager&entity=Requests&key=IN00012345&filepath=attachmentname.pdf&secure=true

    Where YOURINSTANCEID is the ID of your Hornbill instance, IN00012345 is the request reference, and attachmentname.pdf is the name of the file attachment on the request. Make sure you send the API key in the headers as usual, and it should just work.

    Let me know how you get on with this.

    Cheers,

    Steve

    • Like 2
  5. Hi @Jeremy,

    Apologies for the late reply, I've been on holiday. I had a look at this issue before I went on leave, and could not replicate it. The ID from the original file search is being saved correctly, could you compare the ID from your message (1X8DvTeG03xEXT0Zr4oOVvv9t0LcX7MziJ9WBgzpxjsU) with the one in Google Sheets, and see if they match, please? Wondering if it's being truncated or other characters removed from it...

    Thanks,

    Steve

  6. Hi @Jeremy,

    I've just given this a whirl, and I'm unable to replicate the issue :( Are there any information/errors presented in the browser console, as per ther toast message? If not, could you check the response of the call to the iBridgeInvoke API that is made when you visit the node (via the Network tab in the browser developer tools), then this should give us a more descriptive error in the response:

    image.png  

    Cheers,

    Steve

  7. Hi @AndyGilly,

    I've seen this before, and it's usually down to the Windows smart-quote characters finding their way into the dataframe that R is returning to Power BI. If you change csvEncoding variable in the R script to ISO-8859-1 then you should see your data returned to Power  BI again - but with those pesky characters replaced by something that Power BI can handle.

    image.png

    Let me know how you get on.

    Cheers,

    Steve

  8. Hi @Francis von Stein,

    There are 2 events around entity record creation, when we're talking webhooks: 

    • Create : This event is fired before the record is added to the entity, so its payload only contains the user-provided values and NOT any auto-assigned values (including auto-incrementing primary keys);
    • Created  This event is fired after the record is added to the entity, and its payload contains all user provided AND auto-assigned values (including primary keys).

      For example, this is an example of the Create payload:

      {
      	"onEntityEvent": {
      		"eventSource": "urn:webhook:entity:Asset:create",
      		"callingSessionId": "U2020072800159591",
      		"eventTime": "2020-07-28 08:56:36Z",
      		"actionBy": "steveg",
      		"actionByName": "Steve Goldthorpe",
      		"entity": "Asset",
      		"record": {
      			"h_acq_method": "-1",
      			"h_class": "computer",
      			"h_deprec_method": "-1",
      			"h_description": "WEBHOOKTESTER",
      			"h_last_updated": "2020-07-28 08:56:36",
      			"h_last_updated_by": "steveg",
      			"h_location_type": "-1",
      			"h_name": "WEBHOOKTEST",
      			"h_operational_state": "-1",
      			"h_record_state": "1",
      			"h_type": "1",
      			"h_version": "1",
      			"h_booking": "-1",
      			"h_static": "-1"
      		}
      	}
      }

      And this is an example of the Created payload:

      {
      	"onEntityEvent": {
      		"eventSource": "urn:webhook:entity:Asset:created",
      		"callingSessionId": "U2020072800159591",
      		"eventTime": "2020-07-28 08:56:36Z",
      		"actionBy": "steveg",
      		"actionByName": "Steve Goldthorpe",
      		"entity": "Asset",
      		"record": {
      			"h_pk_asset_id": "361",
      			"h_acq_method": "-1",
      			"h_class": "computer",
      			"h_cost": "0.0",
      			"h_created_date": "2020-07-28 08:56:36",
      			"h_deprec_method": "-1",
      			"h_deprec_value": "0.0",
      			"h_description": "WEBHOOKTESTER",
      			"h_disposal_price": "0.0",
      			"h_last_updated": "2020-07-28 08:56:36",
      			"h_last_updated_by": "steveg",
      			"h_location_type": "-1",
      			"h_maintenance_cost": "0.0",
      			"h_name": "WEBHOOKTEST",
      			"h_operational_state": "-1",
      			"h_record_state": "1",
      			"h_residual_value": "0.0",
      			"h_type": "1",
      			"h_version": "1",
      			"h_booking": "-1",
      			"h_static": "-1"
      		}
      	}
      }

      Note the additional auto-assigned properties in the Created payload, including the h_pk_asset_id. So by using the Entity : Asset : Created webhook event, you'll get the information you need:

      image.png  

      Cheers,

      Steve

       

      • Like 1
    • Hi @TIm W,

      Sure. Here are a couple of examples of how you can do what you need using the Hornbill Python API Library, which contains examples and is documented over on Github.

      This is a basic code snippet that will return details of an asset with an exact match on name, where the name of the asset is SGMAC2011:

      from xmlmc import XmlmcService
      from xmlmc import XmlmcHelper
      
      xmlmc = XmlmcService("yourinstanceid")
      xmlmc.set_api_key("yourapikey")
      xmlmc.add_param("application", "com.hornbill.servicemanager")
      xmlmc.add_param("entity", "Asset")
      elem = xmlmc.add_param("searchFilter")
      elem.add_child("column", "h_name")
      elem.add_child("value", "SGMAC2011")
      elem.add_child("matchType", "exact")
      json_string = xmlmc.invoke("data", "entityBrowseRecords2")
      if XmlmcHelper.is_call_success(json_string):
          assetRecords = XmlmcHelper.get_param_value(json_string, "params/rowData/row")[0]
          assetId = assetRecords['h_pk_asset_id']
          assetClass = assetRecords['h_class']
          for attr, value in assetRecords.items():
              print (attr, value)
      else:
          print(XmlmcHelper.get_error_message(json_string))

      Note, we're using the data::entityBrowseRecords2 API to search through the Asset entity in Service Manager, and return the record. We're providing the instance ID (stevegdev here, but replace that with whatever yours is), and an API Key to authenticate the request. The image below shows the returned fields (I'm just looping through the properties of the returned object), and how they can be assigned to new variables you use later in the script.

      image.png

      To add an asset, you can use the relevant Asset Creation API for the class of Asset you are creating. An example being AssetsComputer::addAssetComputer API, which will create a computer type asset:

      from xmlmc import XmlmcService
      from xmlmc import XmlmcHelper
      
      xmlmc = XmlmcService("yourinstanceid")
      xmlmc.set_api_key("yourapikey")
      xmlmc.add_param("name", "MYNEWASSET")
      xmlmc.add_param("type", "1")
      xmlmc.add_param("version", "1")
      json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/AssetsComputer", "addAssetComputer")
      if XmlmcHelper.is_call_success(json_string):
          assetId = XmlmcHelper.get_param_value(json_string, "params/assetId")
          print(assetId)
      else:
          print(XmlmcHelper.get_error_message(json_string))

      Note, if you have a look at the API documentation, it gives you a list of the input parameters. name, type and version are mandatory, and the rest are optional. 

      With regards to the type input, this is the primary key of the asset type that the new asset should be. The easiest way to find out what value you should use here is in the Asset Type Details form in the main app:

      image.png

      To update assets of class Computer, you can use the AssetsComputer::updateAssetComputer API. The code for that will be almost identical to the create code above, except you need to provide the asset ID to update.

      If you do a page search for addAsset, or updateAsset in the Service Manager API documentation, you can find the API's for creating and updating assets of different class.

      Hope this helps,

      Steve

      • Like 1
    • @Nikolaj,

      You'll need to grab the latest release for your OS and architecture from Github, and replace your 3.0.3 executable with that.

      Once that's done, you'll need to make some changes to your config. Firstly you need to remove the square brackets from the output field against the action, then hit save:

      image.png

      Then in Attrib 5, replace the square brackets with curly braces, so it reads:

      {accountExpires}

      Or delete the value and inject it from the variable picker. Note, the newly created variables from the pre-import actions are all below the main variables. So you'll go from this:

      image.png

      To this:

      image.png

      Hope this helps!

      Cheers,

      Steve

       

    • Hi @Nikolaj,

      This is now possible, if you're using v3.6.0 or above of the LDAP Import Tool. We've provided a pre-import action called LDAP Timestamp to Date & Time, which will take a field value containing an LDAP timestamp, and convert it into the YYYY-MM-DD HH:MM:SS format:

      image.png

      So if you inject the Output of this action into one of the users fields (I've chosen Attrib 4, below) then the readable datetime will be written into the field:

      image.png

       

      The user I've imported:

      image.png

      Ansd the users record in Hornbill:

      image.png

      Hope this helps.

      Steve

      • Like 1
    • What's Changed

      • Active Directory Group Management package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Active Directory Group Management package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Active Directory User Management package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342.
      • Active Directory User Management package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Active Directory User Management package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Azure Automation package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Azure Automation package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Dynatrace package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception
      • Dynatrace package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution in SIS build > 3342.
      • Hyper-V package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342.
      • Hyper-V package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Hyper-V package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Nagios XI package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Nagios XI package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • PRTG package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • PRTG package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Rapid7 InsightVM package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342.
      • Rapid7 InsightVM. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Rapid7 InsightVM. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Rundeck package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • Rundeck package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • VMware vSphere package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342.
      • VMware vSphere package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception.
      • VMware vSphere package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
      • Windows Disk Cleanup package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342.
      • Windows Disk Cleanup package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution.
      • Windows Management package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
    ×
    ×
    • Create New...