Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VBScript- Move List of Computers to OU Within another OU

Posted on 2016-09-09
1
60 Views
Last Modified: 2016-09-10
I am working on a script to move computers found in Active Directory to a Disabled Computers OU. The issue I am encountering is that each location has its own OU and the computers must be moved to the Disabled Computers for each location not just a general Disabled Computers OU. For example If a Location is Here then Under Here is the Disabled Computers OU. I am not sure what the proper syntax would be when setting the destination in the script.

I have tried several variations of the following
strNewOU = "LDAP://OU=Here\Disabled Computers," & strDNSDomain
strNewOU = "LDAP://OU=Here\" & """" & "Disabled Computers" & """" & "," & strDNSDomain
strNewOU = "LDAP://OU=Here\Disabled Computers" & strDNSDomain

None of these have worked. Any assistance would be appreciated.
0
Comment
Question by:Frog_1337
1 Comment
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 41792186
Hi, the correct syntax is reverse order, so your structure
Domain.com/Here/Computers/Disabled Computers
Is represented by
strNewOU = "LDAP://OU=Disabled Computers,OU=Computers,OU=Here," & strDNSDomain

Regards,

Rob.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In-place Upgrading Dirsync to Azure AD Connect
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question