I have this info from Microsoft. I know how to remove the files or folders, but the keychain is something I want to script to remove.
See the steps below from Microsoft:
Uninstall Company Portal App from Mac
Delete these files on the machine if they exist:
/Library/Application Support/com.microsoft.CompanyPortal.usercontext.info
/Library/Application Support/com.microsoft.CompanyPortal
/Library/Application Support/com.jamfsoftware.selfservice.mac
/Library/Saved Application State/com.jamfsoftware.selfservice.mac.savedState
/Library/Saved Application State/com.microsoft.CompanyPortal.savedState
/Library/Preferences/com.microsoft.CompanyPortal.plist
/Library/Preferences/com.jamfsoftware.selfservice.mac.plist
/Library/Preferences/com.jamfsoftware.management.jamfAAD.plist
/Users/<username>/Library/Cookies/com.microsoft.CompanyPortal.binarycookies
/Users/<username>/Library/Cookes/com.jamf.management.jamfAAD.binarycookies
Remove anything from the keychain on the machine that references Microsoft, Intune, or Company Portal
Including DeviceLogin.microsoft.com Certificates
Remove Jamf references except for Jamf public and Private key
Removing the public and private key will break enrollment and will be severed from Jamf
Reboot Mac