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