$credentials = Get-Credential
Set-User –identity username –RemotePowershellEnabled $True
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionURI http://exchange-server/powershell -Credential $credentials
Import-PSSession $session