Upload file to ServiceNow ECC Queue through MID Server
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 04:10 PM
Hello friends,
We would like to implement the air-gapped discovery solution e.g. Agent Client Collector and Service Graph Connectors. As a part of this solution, we would be executing commands locally and creating JSON file. This file needed to be taken to ServiceNow instance - ECC Queue for further processing.
I would like to understand how its done.
Any idea, is highly appreciated.
Thanks,
Rahul
Labels:
- Labels:
-
Orchestration (ITOM)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 03:05 AM
From what I understood, you want to upload a file to ECC queue from MID Server. The solution I can think of is a combination of Scheduled Job and powershell script (PS).
- Create a powershell script, I've attached a sample. (Note: This script is not tested, please run it with Infra team first. Also change the extension from .txt to .ps1)
- Create a MID Server file. MID Server > Script Files (set "use attachment = true")
- Attach the powershell script
- Create a scheduled job that executes this PS
- var gr = new GlideRecord('ecc_queue');gr.initialize();gr.agent = 'YOUR MID SERVER'gr.topic = 'Command';gr.name = 'powershell scripts\\PowerShell\\YOURPOWERSHELLSCRIPTNAME';gr.source = '127.0.0.1';gr.queue = 'output';gr.insert();
- Hopefully this should get the script attached to ECC queue. One possible issue that you may run into will be that ecc record generated from PS will have move to processed even before the attachment is added. I would recommend add JSON data as a payload in ECC record rather than an attachment.