This example searches for assets with asset type "Server" and asset ids between 100 and 22500, and Memory is 128 gb. And then updates status and substatus.
If you would like to override security use aipIndexService.queryDocsForObjectOverrideSecurity, if you want permission check with current user use aipIndexService.queryDocsForObject.
Script fetches 1000 assets, it is possible to do paging to process more files, or increase the pageLimit 1000 (think Server memory ).
Please inspect and configure TODO lines in the script!