How to connect to Microsoft cloud with PowerShell

Source: Internet
Author: User

Recently there is a need to use PowerShell to see the migration task status, because Microsoft O365 Web page to see the status of the location is not accurate, you just set up the task, 10 minutes did not say synchronization completed.
So to view the status you have to use PowerShell.
I have a script, but the execution of the total error, translated into Chinese is the script execution policy does not permit.
The first step: So I took the first step with a command:
PS c:\windows\system32> Get-executionpolicy-list

    Scope ExecutionPolicy    ----- ---------------

Machinepolicy Undefined
Userpolicy Undefined
Process Undefined
CurrentUser remotesigned
LocalMachine remotesigned

Second step: Then I was thinking, I'm going to the Microsoft Cloud to verify that this attribute should be remotesigned. That was not the case, so I wrote an order as follows:

PS c:\windows\system32> Get-executionpolicy-list

    Scope ExecutionPolicy    ----- ---------------

Machinepolicy Undefined
Userpolicy Undefined
Process Undefined
CurrentUser remotesigned
LocalMachine remotesigned

PS c:\windows\system32> set-executionpolicy-scope Currentuser-executionpolicy RemoteSigned

Execution Policy Change
The execution policy helps protect you from scripts. Changing the execution policy might expose
The security risks described in the About_execution_policies Help topic at
https:/go.microsoft.com/fwlink/?linkid=135170. Does want to change the execution policy?
[Y] yes [A] yes to all [N] no [L] no-all [S] Suspend [?] Help (Default is "N"): A
PS c:\windows\system32>

The third step, in fact, is still not possible, and then I found another command

The idea of Unlblock-file-path "CLOUDSERVICESSHELL.PS1" is to remove the execution permissions of the script. Then the magic is solved, the script can be executed.

Everyone must want to know what the script code is, because there is our company's information, so not easy to send out, really want, leave a message.

How to connect to Microsoft cloud with PowerShell

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.