dism /online /enable-feature /FeatureName:NetFx3 /All

Setup /PrepareAD /OrganizationName:$name
Setup /Mode:Install /Roles:ManagementTools

## Mailbox role needs FilterPack
Import-Module ServerManager
Add-WindowsFeature NET-Framework-Features, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Basic-Auth, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Net-Ext, Web-Server, Web-Windows-Auth -Restart
Setup /Mode:Install /Roles:Mailbox



## Hubtransport role needs FilterPack
Import-Module ServerManager
Add-WindowsFeature NET-Framework-Features, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Net-Ext, Web-Request-Monitor, Web-Server, Web-Static-Content, Web-Windows-Auth, Web-WMI -Restart
Setup /Mode:Install /Roles:HubTransport



## CAS
Import-Module ServerManager
Add-WindowsFeature NET-Framework-Features, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Net-Ext, Web-Request-Monitor, Web-Server, Web-Static-Content, Web-Windows-Auth, Web-WMI -Restart
Set-Service NetTcpPortSharing -StartupType Automatic
Setup /Mode:Install /Roles:ClientAccess