<div dir="ltr">I found<a href="https://www.cisco.com/c/en/us/support/docs/unified-communications/unity-connection/118299-technote-cuc-00.html#anc8"> this SQL query</a> to return a count of all message boxes in CUC. I modified it to return the top 10 by adding "FIRST 10" immediately after "select" on the first line:<br><div><br></div><div><p class="MsoNormal">run cuc dbquery unitymbxdb1 select FIRST <b><span style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;background-color:yellow">10</span></b> alias as UserID,
count (*) as messages \<span></span></p>
<p class="MsoNormal">from vw_message, unitydirdb:vw_mailbox, unitydirdb:vw_user \<span></span></p>
<p class="MsoNormal">where mailboxobjectid in \<span></span></p>
<p class="MsoNormal">(select mailboxid from vw_mailbox where unitydirdb:
vw_user.objectid = unitydirdb:vw_mailbox.userobjectid) \<span></span></p>
<p class="MsoNormal">group by alias order by \<span></span></p>
<p class="MsoNormal">messages desc<span></span></p><p class="MsoNormal"><br></p><p class="MsoNormal">This works, but it's not very "dev ops friendly." I think I'd have to use an expect script and code in my CLI password... which I really don't want to do.</p><p class="MsoNormal"><br></p><p class="MsoNormal">I looked through the VMREST kit for CUC 10.5 and I don't see anything like this. I can usually find my way around the AXL kit in CUCM but I frequently have issues finding what I need in the CUC VMREST calls.<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">Is there a way to execute this specific query via VMREST to CUC? Is there a VMREST call already baked into CUC that will return similar information?</p><p class="MsoNormal"><br></p><p class="MsoNormal">Thanks,</p><p class="MsoNormal">Nick</p></div></div>