Can you use filters when using the "cadsmcmd" commands ?

Document ID : KB000011057
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

The filter keyword is used to filter the search results based on the string specified.

Question:

Can you use filters  when using the "cadsmcmd" commands ?

Environment:
CA Client Automation - All Versions
Answer:

Please ensure that your specify the filter for this command as follows:

 cadsmcmd targetcomputer action=list filter="Computer name=*901*" 

Syntax of the filter keyword:

 	filter="<Item name><operator><value>" 

<Item name>: To find the possible <Item name> for the cadsmcmd targetgroup please use the cadsmcmd targetcomputer action=showattr command:

Example: cadsmmd targetcomputer action=showattr name=NEUAL19D

--------------------------------------------
Show attributes of target computer
--------------------------------------------
Computer name                    : NEUAL19D
Computer type                      : computer
Network address                  : nnn.mmm.ooo.kkk
Operating system                 : Win 2000 Intel 5.0.2195
Operating system type         : WIN_2000
Calendar name                      :
Owner                                     : NEUAL19
Phone                                      :
Location                                  :
Comment                                 :
Staging server name             :
Creation date                         : 2001-03-06
Creation time                         : 14:04
Change date                           : 2001-05-04
Change time                           : 11:32    :

Item names are: Computer name, Computer type, Network address, ...
 <operator>   
        Operators are: = is equal or matches 
        < is less than 	
        <= is less than or equal 	
        > is greater than 	
        >= is greater than or equal 	
        != is unequal or does not match 

 

<value>
It is possible to use wildcards for values. The asterisk (*) and the question mark (?) are the only valid wildcards.

 

A filter expression consists of the three parts <Item name><operator><value>.
It is possible to combine filter expressions using the following logical operations.

&& And 	
|| Or 

When A and B are valid filter expression than the following constructs are filter expressions too:

(A || B) 	
(A && B) 

Examples:

 

  1. List of all target computers ending with …01?
    cadsmcmd targetcomputer action=list filter="Computer name=*01?"
  2. List of all target computers not ending with …01?
    cadsmcmd targetcomputer action=list filter="Computer name!=*01?"
  3. List of all target computers with Network address= nnn.mmm.ooo.* or Computer name=SUNNY*
    cadsmcmd targetcomputer action=list filter=" ( Network address= nnn.mmm.ooo.* || Computer name=SUNNY*)"
  4. List of all target computers with Network address= nnn.mmm.ooo.* or Computer name=SUNNY*
    cadsmcmd targetcomputer action=list filter=" ( Network address= nnn.mmm.ooo.* && Computer name=SUNNY*)"