Lưu ý về cách sử dụng mới: Windows PowerShell for Office 365


Use Windows PowerShell to manage Office 365

Windows PowerShell Command Builder

Use Windows PowerShell in Exchange Online

Install the Office 365 cmdlets

You can install the cmdlets on a Windows 7 or Windows Server 2008 R2 computer.

You must have Windows PowerShell and the .NET Framework 3.5.1 enabled.

You must install the Microsoft Online Services Sign-in Assistant. Download and install one of the following from the Microsoft Download Center:

To install the Microsoft Online Services Sign-in Assistant:

Microsoft Online Services Sign-In Assistant (IDCRL7) – 32 bit version http://go.microsoft.com/fwlink/p/?linkid=236299

Microsoft Online Services Sign-In Assistant (IDCRL7) – 64 bit version http://go.microsoft.com/fwlink/p/?linkid=236300

To install the Microsoft Online Services Module for Windows PowerShell:

Microsoft Online Services Module for Windows PowerShell (32-bit version) http://go.microsoft.com/fwlink/p/?linkid=236298

Microsoft Online Services Module for Windows PowerShell (64-bit version) http://go.microsoft.com/fwlink/p/?linkid=236297

For more information regarding this article, see the information within the link below:

Use Windows PowerShell to manage Office 365

http://onlinehelp.microsoft.com/en-us/office365-enterprises/hh124998.aspx


Download and Install the Microsoft Online Services Module for Windows PowerShell for Single Sign on.

http://onlinehelp.microsoft.com/en-us/office365-enterprises/ff652560.aspx#BKMK_CreateOrConvertADomain

Click Start > All Programs > Microsoft Online Services (Folder) and select Microsoft Online Services Module for Windows PowerShell

hoặc Windows Azure Active Directory > Windows Azure Active Directory Module for Windows PowerShell

 

Method 1:

How to connect BOTH PowerShell (MOSMWP) and (PS) in one session using Microsoft Online Services Module for Windows PowerShell and Windows PowerShell to Exchange online (O365).

Copy and paste the commands below:

$LiveCred = Get-Credential
Connect-MSOLservice –Credential $livecred
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

Method 2:

How to Connect to Exchange online (O365) using the Microsoft Online Services Module for Windows PowerShell session (MOSMWP)

Import-Module MSOnline
$Creds = Get-Credential
Connect-MsolService –Credential $Creds

Method 3:

$cred=Get-Credential
Connect-MsolService -Credential $cred

How to connect BOTH commands in one session using Regular Windows PowerShell PS (Blue):

Import-module msonline
Connect-MSOLservice
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

To connect to regular Windows PowerShell 2.0 run the command bellow:

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session



1. Additional troubleshooting information:

To Verify the version application, run the command below:

Get-PSSnapin

To Verify that WinRMto connect with O365, run the following commands together:

net start winrm
winrm get winrm/config/client/auth

To Configure WinRM to support basic authentication:
winrm set winrm/config/client/auth @{Basic=”true”}

If The customer was getting some sorts of restriction, the customer enter the following command “

To fix this issue use Run the command bellow:

Set-ExecutionPolicy RemoteSigned

Set-ExecutionPolicy Unrestricted

If the organization has a GPO that has restricted policy, run ther command below:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy unrestricted -force

Additional commands:

Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy unrestricted -force

Set-ExecutionPolicy -Scope MachinePolicy -ExecutionPolicy unrestricted -force

Set-ExecutionPolicy -Scope UserPolicy -ExecutionPolicy unrestricted -force

Set-ExecutionPolicy -Scope Process -ExecutionPolicy unrestricted -force

For more information click here

2. Assign the administrator in the “Organization Management”

If the administrator are having credential issues try the following steps:

In the Exchange Control Panel

1. Select Manage My Organization > Roles & Auditing > Administrator Roles.

2. Click “Organization Management” > details then Add the user as “Member” > Save

Administrator Role Groups in Exchange Online

  • 3. Administrators cannot authenticate to Office 365 by using the following management tools:
    • Microsoft Online Services Directory Synchronization tool (on the directory synchronization server)
    • Microsoft Online Services Module for Windows PowerShell (on a computer on which it is installed)
    • Network connectivity to Office 365 is limited.
    • The firewall, proxy servers, or both require local authentication.
    • Prerequisites of the rich client application are not met.
    • An old version of the Microsoft Online Services Sign-in Assistant is installed.
    • The rich client application is not configured for Office 365.

    Resolution 1: Network connectivity is limited

    Use a browser and try to visit http://www.msn.com

    . If you cannot access this website, troubleshoot network connectivity issues.

    1. At a command prompt, use the ipconfig and ping tools to troubleshoot IP connectivity. For more information about how to do this, click the following article number to view the article in the Microsoft Knowledge Base:
      169790

      How to troubleshoot basic TCP/IP problems

    2. At a command prompt, run nslookup http://www.msn.com to determine whether DNS is resolving Internet server names.
    3. Make sure that the proxy server settings in Internet Options reflect the appropriate proxy server, if a proxy server is used in the local network.
    4. If a Forefront Threat Management Gateway (TMG) firewall is installed on the boundary of the network and the firewall requires client authentication, you might have to install and configure the Forefront TMG client program on the client device for Internet access. Contact your Office 365 administrator for help.

    Resolution 2: Firewall or proxy servers require additional authentication

    To resolve this issue, configure an exception for Microsoft Online Services URLs and applications from the authentication proxy. For example, if you are running Microsoft Internet Security and Acceleration Server (ISA) 2006, create an “allow” rule that meets the following criteria:

    • Allow outbound connections to the following destination: *.microsoftonline.com
    • Allow outbound connections to the following destination: *.microsoftonline-p.com
    • Allow outbound connections to the following destination: *.sharepoint.com
    • Allow outbound connections to the following destination: *.outlook.com
    • Allow outbound connections to the following destination: *.lync.com
    • Allow outbound connections to the following destination: osub.microsoft.com
    • Ports 80/443
    • Protocols TCP and HTTPS
    • Rule must apply to all users.
    • HTTPS/SSL time-out set to 8 hours

    About thangletoan

    Hallo Aloha

    Posted on 01/03/2013, in AD Sync, Microsoft, Microsoft Office, Microsoft Office 365, Password Sync, PowerShell, PowerShell for Office365 and tagged , , , . Bookmark the permalink. 1 Phản hồi.

    1. Tremendous things here. I am very glad to peer your article.
      Thank you a lot and I’m taking a look forward to contact you.
      Will you please drop me a mail?

    Gửi phản hồi

    Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

    WordPress.com Logo

    Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

    Twitter picture

    Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

    Facebook photo

    Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

    Google+ photo

    Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

    Connecting to %s

    %d bloggers like this: