Solved

VBScript- Move List of Computers to OU Within another OU

Posted on 2016-09-09
1
47 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

912 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now