@V S Rawat
Hi,
The cleanmgr.exe tool has two important switches: /SAGESET and /SAGERUN
The way these switches work is you manually run the following command on a particular computer at the cmd prompt:
cleanmgr.exe /SAGESET:123
What you can do to automate everything is run the cleanmgr tool with /SAGESET on a single computer. Then evaluate which registry values it created, and then write a script that will create the same registry values.
For your reference:
https://batchpatch.com/running-the-disk-cleanup-tool-cleanmgr-exe-remotely-on-multiple-computers
In addition, here are some posts with the similar issue with yours, just for your reference, you can try the method mentioned in them:
https://www.reddit.com/r/sysadmin/comments/adhuwy/silently_run_disk_cleanup_with_nno_user_prompt/
Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Hope above information can help you.
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.