- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 11:54 AM
Hi,
I have a requirement to put the export file generated by the export set outside the mid server. I am not allowed to use the symlink solution. since it seems that server now do not allow to specify target path outside the Mid Server, I am thinking using a post script to move the file.
can anyone share a script code that moves the files from the mid server target path to a mapped drive
Thanks
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 09:14 AM
Hi,
you can use post export script and use mid server script include and move the file and then delete it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 01:16 PM
I found the answer. here is an example of code that can be used to put a command in the queue
var ecc = new GlideRecord("ecc_queue");
ecc.initialize();
ecc.agent = "mid.server.MyMidServer2";
ecc.topic = "Command";
ecc.name = "powershell move-item -Path C:\\MidServer\\Mid2\\agent\\export\\*.csv -Destination C:\\Temp";
ecc.queue = "output";
ecc.state = "ready";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 09:12 PM
Hi,
you won't find much example for this as this is a very specific requirement.
you would require knowledge of java packages etc since you will be writing mid server script include.
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 11:05 AM
Hi,
Does any one knows where can I find script example to be called from post export in order to move files from mid server to target folder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 01:16 PM
I found the answer. here is an example of code that can be used to put a command in the queue
var ecc = new GlideRecord("ecc_queue");
ecc.initialize();
ecc.agent = "mid.server.MyMidServer2";
ecc.topic = "Command";
ecc.name = "powershell move-item -Path C:\\MidServer\\Mid2\\agent\\export\\*.csv -Destination C:\\Temp";
ecc.queue = "output";
ecc.state = "ready";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 03:09 AM
But where to write this code in export sets?