It is haram to shave the beard according to majority of scholars. However, in Shafi'e madhab, the preponderant opinion is that it is makrouh.
When it comes to trimming the beard, according to majority of the scholars, it is permissible to trim. But there is a difference in opinion on how much the beard could be trimmed. In Hanafi madhab, it is unlawful to trim the beard shorter than a fistful.