Join EC2 to AD with SSM and remote PowerShell in AWS

Source: Internet
Author: User

1.Create JOINAD.PS1

$username ="Ad-domain\admin"$Password="Password"$pwd= $Password | Convertto-securestring-asplaintext-force$credential= New-object System.Management.Automation.PSCredential ($UserName, $pwd) $Domain="ad.domain.com"$OU="ou=testou,ou=computers,ou=ad-domain,dc=ad,dc=domain,dc=com"ADD-computer-domainname $Domain-credential $credential-oupath $OU –restart

2.upload joinad.ps1 into S3 patch

3.run a command "Aws-runremotescript"

4.select instances

5.source type S3

6.source Info: {"path": "Https://s3.cn-north-1.amazonaws.com.cn/v-script/joinad.ps1"}

7.command LINE:JOINAD.PS1

8.run

Refer

Https://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/integration-remote-scripts.html#integration-s3

Join EC2 to AD with SSM and remote PowerShell in AWS

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.