There's, unfortunately, no brew cask (official or unofficial) for rpcclient, nor is there an official package that can be installed. As such, the SMB portion of the script sadly will not work on a Mac.
If someone finds a version of rpcclient for Darwin or a workaround I'll gladly close this- I spent a few hours trying to find a copy that would work.