• Home
  • Virtualization
    • Citrix
    • VMware
  • Coding
    • Apache
    • Powershell
    • VBScript
  • Applications
    • Windows
      • DHCP
      • Group Policy
      • MDT
  • Mobile
    • Android
    • iOS

the STONYWALL blog

where my mind comes to rest...

Menu
  • Home
  • Virtualization
    • Citrix
    • VMware
  • Coding
    • Apache
    • Powershell
    • VBScript
  • Applications
    • Windows
      • DHCP
      • Group Policy
      • MDT
  • Mobile
    • Android
    • iOS
 › MDT › MDT 2013 Update 2: Adding Domain OU’s with Friendly Names

MDT 2013 Update 2: Adding Domain OU’s with Friendly Names

Derek Bannard November 14, 2016     Comment Closed    

 

Adding computers to the domain is easy if you want them to all end up in the (default) computers OU, or pre-populate the computer account in active directory.

For those of us that like to choose the computer OU on the fly when imaging, entering the OU manually is very tiring and mistakes are often made; at least for me.

To make it easier on the eyes, friendly names are the preferred way.

 

To make this happen, you will need to modify an INI file and create an XML file.  To speed up this process, I have provided the powershell code to make it happen.

 

Manual Steps to Make the Change:

1) Start notepad as an administrator.
2) Open file <DeployRoot>\Scripts\DeployWiz_ComputerName.vbs  (e.g. C:\DeploymentShare by default)
3) Locate the following and make the changes indicated.

Original: Function AddItemToMachineObjectOUOpt(item)

Changed:  Function AddItemToMachineObjectOUOpt(item,value)
Original: oOption.Value = item

Changed:  oOption.Value = value
Original: AddItemToMachineObjectOUOpt oItem.text

Changed:  AddItemToMachineObjectOUOpt oItem.text, oItem.Attributes.getNamedItem("value").value

 

 

 

PowerShell Commands to Make the Changes:

$DomainOUListFile = @"
<?xml version="1.0" encoding="utf-8"?>

<DomainOUs>

	<DomainOU value="OU=Computers,DC=contoso,DC=corp,DC=com">
		Default Computer OU
	</DomainOU>

	<DomainOU value="">
		--[ Site 1 Name ]--
	</DomainOU>

	<DomainOU value="OU=Site 1,OU=Computers,DC=contoso,DC=corp,DC=com">
		Site 1 Computers
	</DomainOU>

	<DomainOU value="">
		--[ Site 2 Name ]--
	</DomainOU>

	<DomainOU value="OU=Site 2,OU=Computers,DC=contoso,DC=corp,DC=com">
		Site 2 Computers
	</DomainOU>

	<DomainOU value="">
		--[ Site 3 Name ]--
	</DomainOU>

	<DomainOU value="OU=Site 3,OU=Computers,DC=contoso,DC=corp,DC=com">
		Site 3 Computers
	</DomainOU>


</DomainOUs>

"@

$FolderPath = "C:\Deploymentshare"
Remove-Item -Path "$FolderPath\Control\DomainOUList.xml" -Force
New-Item -Path "$FolderPath\Control\DomainOUList.xml" -ItemType File -Value $DomainOUListFile


$DWCNFile = "$FolderPath\Scripts\DeployWiz_ComputerName.vbs"
(Get-Content $DWCNFile) | Foreach-Object {
    $_ -replace 'Function AddItemToMachineObjectOUOpt\(item\)', 'Function AddItemToMachineObjectOUOpt(item,value)' `
       -replace 'oOption.Value = item', 'oOption.Value = value' `
       -replace 'AddItemToMachineObjectOUOpt oItem.text', 'AddItemToMachineObjectOUOpt oItem.text, oItem.Attributes.getNamedItem("value").value'
    } | Set-Content $DWCNFile

 

MDT

 Previous Post

MDT 2013 Update 2 not using ADK for WinPE Boot

― November 14, 2016

Next Post 

Java Group Policy (GPO) with Item-Level Targeting

― November 25, 2016

Author: Derek Bannard

Related Articles

Derek Bannard ― December 9, 2019 | Comment Closed

MDT: Manually Update ADK and ADK Addon

You have an MDT server, and it’s working well.Ideally you would NOT like to start fresh with a new MDT

Derek Bannard ― December 9, 2019 | Comment Closed

Execute all queued .NET Compilation Jobs

Derek Bannard ― June 11, 2019 | Comment Closed

Adding DHCP server support for PXE BIOS and UEFI Booting – Version 2

Derek Bannard ― May 30, 2019 | Comment Closed

MDT 2013: Adding a Drivers Catch-All Task Sequence

Derek Bannard ― March 8, 2019 | Comment Closed

Citrix XenApp: Migrating Delivery Groups, the PowerShell Way

Derek Bannard ― February 1, 2019 | Comment Closed

Clear Windows Event-Logs

Derek Bannard ― October 24, 2018 | Comment Closed

Quick Tips: Citrix Studio Application Folder Rename

Derek Bannard ― August 31, 2018 | Comment Closed

PowerShell: Copy and Move Files Using Robocopy and CSV

Search

Categories

Recent Posts

  • MDT: Manually Update ADK and ADK Addon
  • Execute all queued .NET Compilation Jobs
  • Adding DHCP server support for PXE BIOS and UEFI Booting – Version 2
  • MDT 2013: Adding a Drivers Catch-All Task Sequence
  • Citrix XenApp: Migrating Delivery Groups, the PowerShell Way

Archives

  • December 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • October 2018
  • August 2018
  • May 2018
  • April 2018
  • February 2018
  • January 2018
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • November 2016

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org