码迷,mamicode.com
首页 > 系统相关 > 详细

Join EC2 into AD with SSM and remote powershell in AWS

时间:2018-08-06 14:36:24      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:new   use   comm   pts   for   create   domain   test   ref   

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 into AD with SSM and remote powershell in AWS

标签:new   use   comm   pts   for   create   domain   test   ref   

原文地址:https://www.cnblogs.com/oskb/p/9429879.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!