I was very surprised to learn today that you cannot uninstall a single Exchange 2013 role from a serverb.
Quick review: one of the major changes in Exchange 2013 is that the number of server roles has decreased from 5 (hub, mailbox, edge, UM, CAS) to 2 (mailbox and CAS). This approach offers lots of potential benefits, but it also represents a major change to the internals of Exchange.
In Exchange 2007 and Exchange 2010, you could easily combine multiple roles on a single server, adding and removing roles more or less at will. This was fully supported and worked well: running setup with the /roles switch and the appropriate mode would do the trick.
For what I’m sure are excellent reasons, this is no longer supported; attempting to remove either the CAS or mailbox role from a server that has both will produce an error message indicating “invalid command line arguments”. In fairness, this is documented in the release notes, right up at the top– but I missed that the first time around and wanted to mention it here as a reference.
The workaround: if you want to remove a role, you must remove Exchange entirely from the target server, then reinstall only the role you do want.