Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Preparations

Updated on 2024-10-21 GMT+08:00

Configuring a PowerShell Execution Policy

Check the execution policy and ensure that PowerShell allows script execution. Open PowerShell and run the following command to check the current execution policy:

Get-ExecutionPolicy

The PowerShell execution policies are as follows:

  • Restricted: No script can be executed.
  • AllSigned: Only scripts signed by trusted publishers can be run.
  • RemoteSigned: Locally created scripts can be run without signatures, but remotely downloaded scripts must be signed.
  • Unrestricted: All scripts can be executed, but a warning is generated when a script downloaded from the Internet is executed.
  • Bypass: Nothing is blocked and there are no warnings or prompts.

If the execution policy is Restricted or AllSigned, run the following command to temporarily change the policy to allow the execution of locally created scripts and signed remote scripts:

Set-ExecutionPolicy RemoteSigned -Scope Process

This command changes the execution policy only in the current PowerShell session and restores the default policy after the session ends.

Preparing a CSV File

Create a CSV file and write the source server information in the following format to file. Ensure that the file can be accessed.
username,ip,port,password
  • username: indicates the username for logging in to the source server. To ensure that the script has sufficient permissions to perform the modification, you need to run it as a user with administrator permissions, such as Administrator.
  • ip: indicates the private IP address of the source server.
  • port: listening port of the WinRM service. The default port is 5985.
  • password: indicates the password for logging in to the source server. The scripts use this password to automatically connect to the source server through WinRM.
CAUTION:
  • The first row in the CSV file is the header row.
  • Each line in the CSV file contains the information for a single server, with each piece of information separated by a comma.
  • Ensure the format is correct and the information is accurate, avoiding any extra spaces, commas, or invalid IP addresses.
For example:
username,ip,port,password
Administrator,192.168.1.10,xx,examplePass123
Administrator,192.168.1.11,xx,examplePass456

Preparing the Hosts File

Create a text file that contains the content to be added to the hosts file on the source servers. Ensure that the file can be accessed. Write the API domain names mappings for the related cloud services into the file, and start with #Migration-proxy-start and end with #Migration-proxy-end. The API domain name mappings of related cloud services depend on the actual environment. Contact the environment contact person of the corresponding site to obtain the mappings.

For example:
#Migration-proxy-start
xxx.xxx.xxx.xxx  iam.xxx.com
xxx.xxx.xxx.xxx  ecs.xxx.com
xxx.xxx.xxx.xxx  evs.xxx.com
xxx.xxx.xxx.xxx  ims.xxx.com
xxx.xxx.xxx.xxx  obs.xxx.com
xxx.xxx.xxx.xxx  eps.xxx.com
xxx.xxx.xxx.xxx  vpc.xxx.com
#Migration-proxy-end

Preparing a Log Directory

  • Configure the log directory. The scripts use C:\Users\Public\Hosts_Script_Logs as the default log storage directory. If the directory cannot be found, the scripts automatically create it. To change the log storage directory, change the value of $logDir in the script.
  • Check the permissions for the log directory. Ensure that the current user has the write permission for the log directory. If the permissions are insufficient, modify the directory permissions or use another directory.

Checking the Network Connectivity

  • Check the network connection. Ensure that the server where the scripts are executed can access the IP addresses and ports of all Windows source servers over the network. The script executor must be able to access all Windows source servers over port 5985.
  • Configure the firewalls. Check and configure the firewalls on the local computer and source servers to ensure that remote PowerShell sessions can be established through WinRM.
  • Enable the WinRM service. Ensure that the WinRM service has been enabled and is running properly on all Windows source servers. You can run the following command on the source servers to enable WinRM:
    Enable-PSRemoting -Force

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback