让Windows加入域的PowerShell
2015-06-03 15:00
706 查看
$domain = "midrange.lab"
$password = "MyPassword!" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
$password = "MyPassword!" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
来源
========================
Join Computer to Domain With Powershell (One-Click Method)
http://community.spiceworks.com/scripts/show/1540-join-computer-to-domain-with-powershell-one-click-method
相关文章推荐
- shell编程——变量的数值计算
- shell编程——变量的数值计算
- 关掉Windows Firewall的PowerShell
- 修改IP地址的PowerShell
- Shell读取用户输入【以及循环读取验证和while循环中添加多个条件[ .. ] &&或者|| [ .. ]】
- 读shell基础:执行顺序(||及&&,{}及())及正则表表达式 【()和{}的用处】
- 如何得知当前机器上安装的PowerShell是什么版本的?
- unix中统计行数,字符和字数
- 【转载】让Go2Shell支持ITerm2 和x-term
- shell脚本中echo显示内容带颜色 【常用】
- 精选37条强大的常用linux shell命令组合
- shell脚本删除指定mobileprovision
- Microsoft Azure Premium Storage SSD Test
- Shell中脚本变量的作用域
- linux shell随记
- ifconfig命令无法找到,提示bash: ifconfig: command not found
- Xshell的使用 Xshell配色及其编码设置
- Linux shell脚本编程基础之练习篇
- shell中计算器的设计
- HBase shell