【问题标题】:configure automatic domain join and computer naming配置自动加入域和计算机命名
【发布时间】:2021-12-31 20:47:07
【问题描述】:

配置自动加入域、自动计算机命名,并将新计算机帐户放置在适当的组织单位 (OU) 中。 接收来自参考计算机的部署请求,并使用 PXE 和网络安装部署安装映像。 这是我在配置活动目录并创建用户并在 Windows Server 2016 中安装 WPS 服务器后必须做的事情,但我不知道这是什么或如何做,请大家帮忙。

【问题讨论】:

  • 域名加入请查看this
  • 同时检查this scriptthisseries blog
  • 你好@samer hwishan,如果我的回答对你有帮助,你可以投票并接受它作为答案(点击答案旁边的复选标记,将其从灰色切换为已填充。)。这对其他社区成员可能是有益的。谢谢。

标签: active-directory windows-server-2016


【解决方案1】:

• 您可以实现三件事,即,将计算机加入域,将其放入 OU 并通过单个脚本重命名计算机系统,但其他两项任务如您所述,即接收来自的部署请求参考计算机并使用 PXE 部署安装映像,然后应进行网络安装。对于其他两个任务,您可以配置 Windows 部署服务服务器并部署要部署到各自网络的映像,同时在其中启用 PXE 和 DHCP 服务器范围。

• 请找到以下脚本以将计算机加入特定的 OU 并在其后重命名。创建一个“.csv”文件,其中包含要加入域并重命名的计算机的当前名称。然后在每台计算机上分别运行以下脚本:-

 ‘ Enable-PSRemoting -SkipNetworkProfileCheck -Force ’ --> After running this cmd locally on each computer, run the below script from a domain controller as it will connect remotely through powershell to each computer and join it to domain

  ‘ Import-Module ActiveDirectory
    $inputFilePath = <Path of the csv file>
    $computers = Get-Content -Path $inputFilePath
    $domain = <domainname>
    $credentials = Get-credential -username <domain admin username> -password <password>
    foreach ($computer in $computers)
   {
      $ScriptBlock = {Param($computer)
       Add-Computer -DomainName $domain -ComputerName $computer -newname <NewComputerName> -OUPath “OU=testOU,DC=domain,DC=Domain,DC=com”-Credential $credentials -Restart -Force
      }
$session = New-PSSession -ComputerName $computer

Invoke-Command -Session $session -ScriptBlock $ScriptBlock -ArgumentList $computer
Remove-PSSession -Session $session           
  } ’

• 对于通过 PXE 加入域后通过 WDS 部署映像,请参阅以下链接:-

https://www.microsoftpressstore.com/articles/article.aspx?p=3089351&seqNum=4

【讨论】:

    猜你喜欢
    • 2017-04-07
    • 2015-03-20
    • 2019-07-05
    • 2011-09-07
    • 1970-01-01
    • 2015-03-17
    • 2012-05-10
    • 2017-06-12
    • 2017-01-01
    相关资源
    最近更新 更多