August 30, 2012

Office 365 Exchange PowerShell



How to Connect Office 365 Exchange PowerShell
 


PS C:\> $LiveCred = Get-Credential
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
PS C:\> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
WARNING: Your connection has been redirected to the following URI:
"https://pod51024psh.outlook.com/PowerShell-LiveID?PSVersion=2.0 "

PS C:\>  Import-PSSession $Session
Import-Module : There were errors in loading the format data file:
Microsoft.PowerShell, , C:\Users\sunit.patil\AppData\Local\Temp\tmp_0e6d6cc4-ebfb-42bb-8a84-6c4d3a355c5d_11uaavx2.dls\t
mp_0e6d6cc4-ebfb-42bb-8a84-6c4d3a355c5d_11uaavx2.dls.format.ps1xml : File skipped because of the following validation e
xception: File C:\Users\sunit.patil\AppData\Local\Temp\tmp_0e6d6cc4-ebfb-42bb-8a84-6c4d3a355c5d_11uaavx2.dls\tmp_0e6d6c
c4-ebfb-42bb-8a84-6c4d3a355c5d_11uaavx2.dls.format.ps1xml cannot be loaded because the execution of scripts is disabled
 on this system. Please see "get-help about_signing" for more details..
At line:3 char:30
+                 Import-Module <<<<  -Name $name -Alias * -Function * -Prefix $prefix -DisableNameChecking:$disableNam
eChecking -PassThru -ArgumentList @($session)
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\> Set-ExecutionPolicy RemoteSigned

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution
policy?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
PS C:\> net start winrm
The Windows Remote Management (WS-Management) service is starting..
The Windows Remote Management (WS-Management) service was started successfully.

PS C:\> winrm get winrm/config/client/auth
 Auth
    Basic = true
    Digest = true
    Kerberos = true
    Negotiate = true
    Certificate = true
    CredSSP = false

PS C:\>  Import-PSSession $Session
ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Script     tmp_64a0f829-e6d8-41ee... {Set-RoleGroup, Set-RMSTrustedPublishingDomain, Disable-UMAutoAttendant,...

1 comments:

Anonymous said...

“The different necessary half of} screening is that unlike to|not like} substance abuse or different issues that have extra outward bodily signs, gambling habit is what we regularly 카지노사이트.online name the hidden habit,” Whyte said. Today, about 2 million, or 1 % of adults, in the us are estimated to fulfill the standards for pathological gambling. Another four million to 6 million could be thought-about drawback gamblers. About a hundred and fifty objects thought-about sacred by the Sioux peoples that have been saved at a small Massachusetts museum for greater than a century are being returned.