Use PowerShell to Replace netdom Commands to Join the Domain

使用Powershell替代netdom命令将计算机加入域

本文摘自:http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/29/use-powershell-to-replace-netdom-commands-to-join-the-domain.aspx

这里仅摘录部分信息,更详细请点击此链接

Microsoft Scripting Guy, Ed Wilson, is here. Well this afternoon I am drinking something a bit different. I decided to make a cup of masala chai. (The word chai, or many of its variations, simply means tea in many languages. Therefore, to speak of chai tea is redundant.) Anyway, I decided to use Dajarling tea, brewed a little strong, and I added cloves, cardamom, a cinnamon stick, fresh ground pepper, and 1/3 cup of warm milk. Coupled with an Anzac biscuit, it was quite nice.

AD, the reason that you cannot use your batch file (containing netdom commands) on Windows 7 is that by default Windows 7 does not contain the netdom command. You can add netdom to your computer running Windows 7 by installing the latest version of the Remote Server Administration Tools (RSAT). When it is installed, you still need to go to Programs and Features and turn on the tools you want to load. The RSAT tools are great, and that is where you gain access to the Active Directory module. But you should not load the RSAT only to access netdom, because you can do what you want to accomplish out of the box (assuming that your box is not Windows 7 Home edition that does not join domains).

AD, your batch file contained at least three commands to rename the computer, join the domain, and to restart the machine. The two netdom commands and the shutdown command are shown here.

netdom renamecomputer member /newname:member1.example.com /userd:administrator

netdom add /d:reskita mywksta /ud:mydomain\admin /pd:password

shutdown /r

In Windows PowerShell 2.0, this is still three commands, but at least the commands are native to Windows 7. In addition, the Windows PowerShell command is easier to read, and they support prototyping. An example of using Windows PowerShell to add a computer to the domain, rename the computer, and reboot the machine is shown here.

(Get-WmiObject win32_computersystem).rename("newname")

add-computer -Credential iammred\administrator -DomainName iammred.net

Restart-Computer

转载于:https://blog.51cto.com/10500561/1671368

Use PowerShell to Replace netdom Commands to Join the Domain相关推荐

  1. Powershell About Active Directory Group Membership of a domain user

    使用Get-User命令去寻找group membership of a domain user $((Get-ADUser Wendy -Properties *).MemberOf -split ...

  2. powershell 学习笔记

    命令模式        //字符串不需要加引号,除变量和圆括号中的内容外的所有内容均可看作字符串        copy users.txt accounts.txt        copy $src ...

  3. power linux 安装系统,powershell 安装服务器

    如何在 Windows Server 2008 上安装 Exchange 2007 SP1 先决条件 ${textbanner3.replace("\n","" ...

  4. ssis 执行任务的日志_SSIS和PowerShell –执行流程任务

    ssis 执行任务的日志 介绍 (Introduction) SQL Server Integration Services (SSIS) and PowerShell (PS) together o ...

  5. Powershell tricks::Powershell Remoting

    DM_ · 2014/11/03 10:03 0x01 简介 Powershell Remoting建立在windows WinRM服务之上,可以一对一或一对多远程控制,也可以建立HTTP 或 HTT ...

  6. 在Windows Server 2016 Core上运行SQL Server容器

    SQL Server和容器 (SQL Server & Containers) There's a lot of buzz around containers at the moment bu ...

  7. YOLOv4:目标检测(windows和Linux下Darknet 版本)实施

    YOLOv4:目标检测(windows和Linux下Darknet 版本)实施 YOLOv4 - Neural Networks for Object Detection (Windows and L ...

  8. 记录一次无聊的(经历了Nodejs - Shell - C)的探索问题过程

    提出问题 在运行项目的服务器的git是1.8.3.1版本的时候,pm2 deploy 项目,服务器fetch不到最新的一次commit. 对于这个问题,在pm2的github也有issues讨论.然后 ...

  9. 05-01-部署 WSUS on Windows 2019 Core

    <系统工程师实战培训>  -05-部署补丁管理服务器  -01-部署 WSUS on Windows 2019 Core 1. 加域/退域  //加域  netdom join 031-W ...

最新文章

  1. hdc mfc 画扇形图_使用echarts绘制条形图和扇形图
  2. QIIME 2教程. 31名词Glossary(2020.11)
  3. 2017年度盘点:15个最流行的GitHub机器学习项目 By 机器之心2017年12月21日 15:23 在本文中,作者列出了 2017 年 GitHub 平台上最为热门的知识库,囊括了数据科学、机
  4. lnmp mysql 路径_LNMP笔记:更改网站文件和MySQL数据库的存放目录
  5. 如何维持手机电池寿命_手机电池不耐用,都怪这些充电坏毛病
  6. 中断数周之后 微软网站恢复销售华为笔记本电脑
  7. mysql相交_PHP-Mysql相交结果
  8. 面向自动驾驶行业,Imagination推出性能高达600 TOPS的多核AI加速器
  9. gge加MySQL_mysql分布式中间件cobar
  10. 记ICS的lab2--bomb实验
  11. CSS解决图片过大撑破DIV的方法
  12. Win10“混合现实门户”图标更新:加入Fluent Design风格
  13. python图片旋转脚本_封装了深度学习中几个图片数据增强的脚本-python平移、旋转与调整大小...
  14. 子平真诠释疑笔记(三)
  15. 英汉对照名言隽语(二)
  16. linux双网卡网桥转发,Linux网桥实现
  17. TensorFlow知网文章1-TensorFlow平台下的视频目标跟踪深度学习模型设计
  18. Java 实现连连看算法
  19. h5引入json_H5页面内使用JSON动画
  20. java模拟多人接力赛跑_Java多线程--模拟接力赛跑

热门文章

  1. 人工智能的下一个道德挑战:如何对待动物
  2. 新计算推动信息技术产业新发展?
  3. 传阿里腾讯即将大裁员,最高涉及30%员工
  4. 苹果新功能惹众怒,4000 多家组织和个人签署公开信,敦促苹果放弃“儿童安全”功能...
  5. 世界上第一台电子计算机到底是谁发明的?
  6. UDP,你要耗子喂汁呀!
  7. 面试官:兄弟,说说 ArrayList 和 LinkedList 有什么区别
  8. Google 排名第一的语言,引数十万人关注:搞定它,技术大牛都甘拜下风
  9. selectepoll
  10. C++托管代码生成DLL