Windows PowerShell Management Office 365

Source: Internet
Author: User

Windows PowerShell Management Office 365

As we mentioned earlier, what we can do and what we can achieve through the O365 management center, Exchange management center, and Lync Management Center SharePoint Management Center is far from meeting customers' time needs. You can use the Azure Active Directory module cmdlet for Windows PowerShell to execute Azure AD management tasks. You can also use a single Windows PowerShell window to connect to and simultaneously manage Office 365, SharePoint, Exchange, and Lync management tasks. Next let's take a look at how to implement it.
1. Prerequisites
System Requirements for installing the Azure AD Module
Windows 8.1, Windows 8, Windows 7, Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2.

Software requirements and Download Links
 Microsoft Online Services logon assistant. The download link is as follows:
Http://www.microsoft.com/zh-cn/download/details.aspx? Id = 41950
Download the Microsoft Azure Active Directory module from the following link:
Http://go.microsoft.com/fwlink/p? Linkid = 236297
Unzip Windows PowerShell Module for Lync Online. The download link is as follows:
Http://www.microsoft.com/en-us/download/details.aspx? Id = 39366
 SharePoint Online Management Shell. The download link is as follows:
Http://www.microsoft.com/en-us/download/details.aspx? Id = 35588
Note: 1. the Azure Active Directory module (32-bit version) for Windows PowerShell will be officially disabled from January 1, October 20, 2014;
2. Exchange Online has no independent modules and is already included in Azure AD;
3. You must first Install the Microsoft Online Services logon assistant to install other components.
2. install necessary components
Download the four installation programs based on the links provided above, which is about 15 MB;

Run the Microsoft Online Services logon Assistant (msoidcli_64) and click "Install".


The installation is also fast. Click "finish"

Run the Microsoft Azure Active Directory Module Program and click "Next"
Vc29mdCBBenVyZSBBY3RpdmUgRGlyZWN0b3J5IMSjv + mzzNDy "border =" 0 "src =" http://www.bkjia.com/uploads/allimg/160409/040U34K0-3.png "title =" run Microsoft Azure Active Directory Module Program "/>

 


Select "I Accept the terms in the License Terms" and click "Next"

Confirm the installation path and whether to generate a desktop shortcut. Click "Next"


Click "Install"

After the installation is complete, click "Finish"

 

Run the LyncOnlinePowerShell Module Program, check "I agree to the license terms and conditions", and click "Install"

After successful installation, click "Close"

 

Run the SharePointOnlineManagementShell module installer, select "I accept the terms in the license Agreement", and click "Install"



After the installation is complete, click "Finish"

On the control panel, you can confirm that the above four components have been installed,

 

3. Connect to the Office 365
Run Windows PowerShell on this computer as an administrator;



Run the "Get-Module" command. You can see that there are currently only two modules

Run the "Import-Module MsOnline" command to Import the O365 Module. Run "Get-Module". You can see that one more Module has been imported;

Run "$ credential = Get-Credential", enter the O365 Administrator account and password, and create O365 creden;

Connect to O365 by running the Connect-MsolService-Credential $ credential command to ensure that no error or warning is reported;

Now you can manage O365. You can run the following commands for testing:


4. Connect to SharePoint Online
Run the "Import-Module Microsoft. Online. SharePoint. PowerShell" command to Import the Module. You will receive a warning that some commands can not be imported. You can add-Verbose to Import the Module again.

Run the Connect-SPOService-Urlhttps: // itlight-admin.sharepoint.com-credential $ credential to Connect to SharePoint Online.



Note: The above is the command used to connect to the global version. When connecting to the Chinese version of O365 SharePoint Online, use the following command:


Connect-SPOService-Urlhttps: // The itlight-admin.sharepoint.cn-credential $ credential"

To confirm that the connection is connected, ENTER the "Get-SPOSite" command at the Windows PowerShell prompt and press ENTER.

5. Connect to Lync Online
Run the "Import-Module LyncOnlineConnector" command to Import the Lync Module. An error "script cannot be run on this system" is reported. For example:



At the beginning, I also encountered this problem. I finally found out after searching the Technet document and consulting the O365 technical support, because of the ExecutionPolicy issue. Change the default policy to "RemoteSigned" and then re-import the module.

Run the following command to load the Lync Online management script
$ LyncSession = New-CsOnlineSession-Credential $ credential
Import-PSSession $ lyncSession



6. Connect to Exchange Online
Run the following command to load the Exchange Online management script
✓ Chinese Version O365
$ Session = New-PSSession-ConfigurationName Microsoft. Exchange-ConnectionUrihttps: // partner.outlook.cn/PowerShell-LiveID/-Credential $ UserCredential-Authentication Basic-AllowRedirection
Import-PSSession $ Session
✓ Global version O365
$ ExchangeSession = New-PSSession-ConfigurationName Microsoft. Exchange-ConnectionUri "https://outlook.office365.com/powershell-liveid/"-Credential $ credential-Authentication "Basic"-AllowRedirection
Import-PSSession $ exchangeSession

Through the above configuration process, we have achieved unified management of Office 365, Exchange Online, Lync Online, and SharePoint Online through a single Windows PowerShell. In this way, batch management operations will be very convenient in the future, especially for tasks that cannot be implemented by many management centers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.