Is there a way to add keywords in client descritpion in bulk
Hi,
I created a client group to include 100+ clients using auto association based on rules.
I am looking for a way to add the same keywords in client description of every client in this group.
As there are more than 100 clients, if it is possible I am trying to avoid going through them one by one to add this keyword.
Kind regards,
Boyi
Page 1 / 1
Hi @Boyi,
Can you share the reasoning behind it why you want to populate this field? I'm asking because the description field is not exposed in Command Center and it also doesn't seem a this field can be pulled via the REST API.
Run a query to get the clientid of all the members.
Foreach through the list and set the description via rest or qcommand
@chrisknows using a workflow to address might be the best approach for you but others prefer a different solution, like me
I would personally script it away because you can execute the qcommand from an external script as well. @MFasulo what is you take on this? any ideas if the description field is brought to Command Center as well which should mean you can set if via the REST API.
The workflow is just alot easier.
honestly it could be whipped up in five minutes.
The workflow is just alot easier.
honestly it could be whipped up in five minutes.
It was more like 10 minutes, but powershell would take a lot longer.
cut-n-paste this into the xml tab of a new workflow and boom it should work.
I did zero testing, the only place I expect it to fail is where the for loop is defined because I couldn’t remember if the column index is zero based or 1 based.
Testing is additional because remember boys and girls ….
@chrisknows using a workflow to address might be the best approach for you but others prefer a different solution, like me
I would personally script it away because you can execute the qcommand from an external script as well. @MFasulo what is you take on this? any ideas if the description field is brought to Command Center as well which should mean you can set if via the REST API.
You can basically modify any commvault entity in powershell by doing the update as a qoperation.
for example in this case you would just use the App_SetClientPropertiesRequest xml or json equivalent.
It’s more powerful in powershell because you import the xml file into powershell and set the properties like so :
association.entity.clientName = “WhateverIwant” and submit it to update it.
You could stick it in a function and pipeline the hell out of it as well.
It’s kind of the reason why I shy away from the sdk, since you can update any object essentially via qoperation you just need to build a small libary of object xml and you can modify all willy nilly, or better yet you can pull a copy of the object via rest modify the pieces you want to update and submit the app_set equivalent.
Personally this is the list of commvault entities that I have saved, I have a function that I call to objectify the xml for modification and then convert it back to xml to perform entity updates.
For entities that I don’t have I can export via “save as script” and pull the xml from there.
Hi guys,
Thanks for the reply. In our environment we put TAG_XXX in client description for certain clients so we can create client groups for reporting etc.
The request I receive is to create a report for clients that meet certain criteria. At this stage we don't have an existing TAG for this group but I managed to achieve it with the help of multiple other rules to create this client group. To make it easier for us when we need to add new clients in the group, I was wondering if there is a way to create a new TAG in the description for existing clients. In that case I can do the grouping based on this TAG. In the future we just need to add this TAG for new clients and they will be included in the same client group.
I am not good at workflow or programming so SetClientDescription suggested by @Onno van den Berg might be easier for me. I will give it a try thank you. Also thank you @chrisknows for you input.
Kind regards,
Boyi
@Onno van den BergI used SetClientDescription and it cleared the existing content in the description field and then add the TAG I input. Is there another script that I can try to add this tag to the existing description?
You need to explain more clearly what you want to happen here.
Please give an example of a description of before and after the tag.
@christopherlecky
The client I did the test on is called stg-mgtbk7t001.
Before I ran the script, content of the description filed was as below.
In our environment, we have client groups for TAGs above. For example, we have a client group that contains all decommissioned clients. This client group is created using automatic association so for any new decommissioned client, we can just add this tag to the description of the client and it will be included in this client group automatically.
When I ran qoperation execscript -sn SetClientDescription -si stg-mgtbk7t001 -si TAG_TEST=123, I was expecting to have ‘test123’ added to the existing description as per below. TAG_CFSID=EXCLUDE, TAG_REPORTING=none, TAG_FILTER=STD-WINDOWS, TAG_DECOMMISSION=YES, TAG_TEST=123,
but result was as below. TAG_TEST=123,
So it removed all my existing TAGs and then added TAG_TEST=123 in which was not the result I want
@Boyi yes, it will not append the input to the description field. if you want this than you will have to read the existing payload and add the new entry that you want to add and re-apply the payload or just make sure you make it so dynamic that you just apply the entire payload.
as far as I'm aware of there are no standard tools that offer the possibility to append. so you will have to work around it using the qscript, REST API or workflow.