This command is used to ban a specific user or host mask from the channel. It will handle the setting of channel mode +b for you. People with an access level of 5 (AOP) or higher to the channel may use this command to ban specific users, while channel founders can use this command to ban host masks. Note that half operators and above in a channel may use mode to perform either of those tasks. This command accepts 2 to 4 arguments, the name of the channel to issue the ban, an optional expiry time, the nickname or host mask to ban, and an optional ban reason.
This is the recommended way to ban users from channels, as it is usually easier to use than the mode IRC command. Your client may come with an easy to use ban command. Consult your client's documentation regarding this. If you wish to ban nick1 from #channel for 2 days for the reason "Repeated channel flooding", you can use this command:
/msg ChanServ ban #channel +2d nick1 Repeated channel flooding
Note that the + symbol is required before the ban time. You can omit this field for a ban that will be permanent until manually unset by either the mode IRC command or an unban command.