The following configuration can be used in a Configuration Manager Zero Touch OS Deployment to automatically move a computer object to the correct OU according to its Active Directory site.
For this example, we will be moving the computer AD object to the “CityOU” OU if it is currently in the “CitySite” AD Site.
- Open your OS Deployment Task Sequence
- Select ‘Add’ ‘Settings’ and then ‘Apply Network Settings’
- Change the name to “Apply Network Settings – City”
- From the ‘Properties’ tab,
- select ‘Join a domain’
- Enter in the name of the domain
- Using the Browse button, select the correct OU (CityOU)
- Enter in an account username and password which has access to move computer AD objects
- From the ‘Options’ tab
- Select ‘Add Condition’ then ‘If statement’
- With ‘All conditions’ selected, click ‘OK’
- Select ‘Add Condition’ and then ‘Query WMI’
- Under ‘QWL Query’ enter
select * from Win32_NTDomain where ClientSiteName = 'CitySite'
- Click ‘Apply’ to save the changes.