how does Operation "Parse Command OutPut" work for windows server ?

venkat101
Tera Guru

Hi,

I like to know how pattern Operation "Parse Command Output" works for windows server. I am trying to get list of directories in a folder. Can you suggest if this operation helps to get that or any other way ?

 

With regards,

Venkat

1 ACCEPTED SOLUTION

Tom Sienkiewicz
Mega Sage

Hi, it sounds like this is the right command to use in your case. It can run most of commands you would normally execute directly on the host.

Something like (of course make sure you do it in your specific path):

dir /ad

should return the list of directories, which you can then parse using delimited text or regex, for the specific value you need.

Sometimes you may need to add user and password to your command, as mentioned here:

https://docs.servicenow.com/en-US/bundle/sandiego-it-operations-management/page/product/service-mapp...

Just switch to debug mode in your pattern and experiment live until you get satisfying results.

View solution in original post

1 REPLY 1

Tom Sienkiewicz
Mega Sage

Hi, it sounds like this is the right command to use in your case. It can run most of commands you would normally execute directly on the host.

Something like (of course make sure you do it in your specific path):

dir /ad

should return the list of directories, which you can then parse using delimited text or regex, for the specific value you need.

Sometimes you may need to add user and password to your command, as mentioned here:

https://docs.servicenow.com/en-US/bundle/sandiego-it-operations-management/page/product/service-mapp...

Just switch to debug mode in your pattern and experiment live until you get satisfying results.