This simply cannot be done. It would be a security violation. Passwords are encrypted and cannot be changed by any entity other than the BIOS itself. Clearing passwords requires physical presence, which can never be achieved from software. There is no mechanism for reading the passwords once an O/S is loaded.
The requirements for secure password implementation are full documented in the UEFI specifications. I welcome you to read these at you leisure...