Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Last active March 25, 2017 23:35
Show Gist options
  • Select an option

  • Save PrateekKumarSingh/b27112b99736e4bbb1c849f3352e46c8 to your computer and use it in GitHub Desktop.

Select an option

Save PrateekKumarSingh/b27112b99736e4bbb1c849f3352e46c8 to your computer and use it in GitHub Desktop.
$domain = 'domain\Username'
$pass = ConvertTo-SecureString -String 'somepassw@rd123' -AsPlainText -Force
$creds = New-Object System.Management.Automation.pscredential -ArgumentList $domain, $pass
$s = New-PSSession -ConfigurationName Microsoft.Exchange `
-ConnectionUri http://ExchangeServerName/PowerShell/ `
-Authentication Kerberos `
-Credential $creds
Import-PSSession $s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment