This should work to convert your user login to pass through the script. Also, you can look at saving your password to a file if you want to have better security around your script.
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
or to file...
read-host -assecurestring | convertfrom-securestring | out-file C:\cred.txt
Once we have our password safely stored away, we can draw it back into our scripts..
$password = get-content C:\cred.txt | convertto-securestring
Then finally, we can create our credential object, which we pump into other cmdlets.
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "myusername",$password
Then you can loop through each site collection. Wrap the code from your previous link into a function (Get-Forms) and loop through each site collection. You can opt to run this on a weekly schedule and exported the results to a SharePoint file library that held these kind of csv files.
$SiteCollections = Get-SPSite 'https://<site name>' | Get-SPWeb -Limit All | Select Title
foreach($Sitecollection in $SiteCollections){
Get-Forms -SiteCollection $SiteCollection
}