| Author | Messages | |
DhirajHaritwal
Posts:44
 | | 08/12/2008 5:27 PM |
| Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
------------------------------------------------------------------- This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway. -------------------------------------------------------------------
| | | |
| bdesmond
Posts:374
 | | 08/12/2008 5:34 PM |
| Adfind piped to admod will do it - there should be suitable examples in the usage.
Thanks, Brian Desmond brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 4:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
________________________________
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway. ________________________________
| | | |
| michael1
Posts:184
 | | 08/12/2008 5:38 PM |
| Ensuring that you target the rid master. J
Regards,
Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:32 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Adfind piped to admod will do it - there should be suitable examples in the usage.
Thanks,
Brian Desmond
brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 4:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
_____
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway.
_____
| | | |
| bdesmond
Posts:374
 | | 08/12/2008 5:40 PM |
| Why?
Thanks, Brian Desmond brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Michael B. Smith Sent: Tuesday, August 12, 2008 4:35 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Ensuring that you target the rid master. 
Regards,
Michael B. Smith MCITP:SA,EMA/MCSE/Exchange MVP http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:32 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Adfind piped to admod will do it - there should be suitable examples in the usage.
Thanks, Brian Desmond brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 4:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
________________________________
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway. ________________________________
| | | |
| michael1
Posts:184
 | | 08/12/2008 6:04 PM |
| Sorry. Source RID master.
We just had this convo a few weeks ago. Excerpt from IADScontainer::MoveHere
In Active Directory, you can move an object within the same domain or from different domains in the same directory forest. For the cross domain move, the following restrictions apply:
* The destination domain must be in the native mode. * Objects to be moved must be a leaf object or an empty container. * NT LAN Manager (NTLM) cannot perform authentication; use Kerberos authentication or delegation. Be aware that if Kerberos authentication is not used, the password transmits in plaintext over the network. To avoid this, use delegation with secure authentication. * You cannot move security principals (for example, user, group, computer, and so on) belonging to a global group. When a security principal is moved, a new SID is created for the object at the destination. However, its old SID from the source, stored in the sIDHistory attribute, is preserved, as well as the password of the object.
Note Use the Movetree.exe utility to move a subtree among different domains. To move objects from a source domain to a destination domain using the Movetree command-line tool, you must connect to the domain controller holding the source domain's RID master role. If the RID master is unavailable then objects cannot be moved to other domains. If you attempt to move an object from one domain to another using the Movetree tool and you specify a source domain controller that is not the RID master, a nonspecific "Movetree failed" error message results
And then joe said in his comment about admod (which is why I said destination the first time, I didn't read the entire thread):
As for why you have to specify the destination host... I believe (I wrote that code over 2 years ago) the CROSSDOM Server control requires a DC in FQDN format to be specified in the control. I could probably crutch it by doing some extra work and picking a DC through the locator process if not specified but honestly, something like this should be pretty well defined in what you are doing and I wanted people to understand what they are doing. Also, if I wanted someone to specify a RID master I would have specified it in the usage, at least I expect I would. <eg>
Regards,
Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:37 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Why?
Thanks,
Brian Desmond
brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Michael B. Smith Sent: Tuesday, August 12, 2008 4:35 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Ensuring that you target the rid master. J
Regards,
Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:32 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Adfind piped to admod will do it - there should be suitable examples in the usage.
Thanks,
Brian Desmond
brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 4:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
_____
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway.
_____
| | | |
| bdesmond
Posts:374
 | | 08/12/2008 6:18 PM |
| The OP is not doing a cross domain move.
Thanks, Brian Desmond brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Michael B. Smith Sent: Tuesday, August 12, 2008 5:00 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Sorry. Source RID master.
We just had this convo a few weeks ago. Excerpt from IADScontainer::MoveHere
In Active Directory, you can move an object within the same domain or from different domains in the same directory forest. For the cross domain move, the following restrictions apply:
* The destination domain must be in the native mode. * Objects to be moved must be a leaf object or an empty container. * NT LAN Manager (NTLM) cannot perform authentication; use Kerberos authentication or delegation. Be aware that if Kerberos authentication is not used, the password transmits in plaintext over the network. To avoid this, use delegation with secure authentication. * You cannot move security principals (for example, user, group, computer, and so on) belonging to a global group. When a security principal is moved, a new SID is created for the object at the destination. However, its old SID from the source, stored in the sIDHistory attribute, is preserved, as well as the password of the object. Note Use the Movetree.exe utility to move a subtree among different domains. To move objects from a source domain to a destination domain using the Movetree command-line tool, you must connect to the domain controller holding the source domain's RID master role. If the RID master is unavailable then objects cannot be moved to other domains. If you attempt to move an object from one domain to another using the Movetree tool and you specify a source domain controller that is not the RID master, a nonspecific "Movetree failed" error message results
And then joe said in his comment about admod (which is why I said destination the first time, I didn't read the entire thread):
As for why you have to specify the destination host... I believe (I wrote that code over 2 years ago) the CROSSDOM Server control requires a DC in FQDN format to be specified in the control. I could probably crutch it by doing some extra work and picking a DC through the locator process if not specified but honestly, something like this should be pretty well defined in what you are doing and I wanted people to understand what they are doing. Also, if I wanted someone to specify a RID master I would have specified it in the usage, at least I expect I would. <eg>
Regards,
Michael B. Smith MCITP:SA,EMA/MCSE/Exchange MVP http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:37 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Why?
Thanks, Brian Desmond brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Michael B. Smith Sent: Tuesday, August 12, 2008 4:35 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Ensuring that you target the rid master. 
Regards,
Michael B. Smith MCITP:SA,EMA/MCSE/Exchange MVP http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:32 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Adfind piped to admod will do it - there should be suitable examples in the usage.
Thanks, Brian Desmond brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 4:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
________________________________
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway. ________________________________
| | | |
| michael1
Posts:184
 | | 08/12/2008 6:20 PM |
| Ever had a really bad day? I'm having one. My bad. Sorry.
Regards,
Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 6:15 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
The OP is not doing a cross domain move.
Thanks,
Brian Desmond
brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Michael B. Smith Sent: Tuesday, August 12, 2008 5:00 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Sorry. Source RID master.
We just had this convo a few weeks ago. Excerpt from IADScontainer::MoveHere
In Active Directory, you can move an object within the same domain or from different domains in the same directory forest. For the cross domain move, the following restrictions apply:
* The destination domain must be in the native mode. * Objects to be moved must be a leaf object or an empty container. * NT LAN Manager (NTLM) cannot perform authentication; use Kerberos authentication or delegation. Be aware that if Kerberos authentication is not used, the password transmits in plaintext over the network. To avoid this, use delegation with secure authentication. * You cannot move security principals (for example, user, group, computer, and so on) belonging to a global group. When a security principal is moved, a new SID is created for the object at the destination. However, its old SID from the source, stored in the sIDHistory attribute, is preserved, as well as the password of the object.
Note Use the Movetree.exe utility to move a subtree among different domains. To move objects from a source domain to a destination domain using the Movetree command-line tool, you must connect to the domain controller holding the source domain's RID master role. If the RID master is unavailable then objects cannot be moved to other domains. If you attempt to move an object from one domain to another using the Movetree tool and you specify a source domain controller that is not the RID master, a nonspecific "Movetree failed" error message results
And then joe said in his comment about admod (which is why I said destination the first time, I didn't read the entire thread):
As for why you have to specify the destination host... I believe (I wrote that code over 2 years ago) the CROSSDOM Server control requires a DC in FQDN format to be specified in the control. I could probably crutch it by doing some extra work and picking a DC through the locator process if not specified but honestly, something like this should be pretty well defined in what you are doing and I wanted people to understand what they are doing. Also, if I wanted someone to specify a RID master I would have specified it in the usage, at least I expect I would. <eg>
Regards,
Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:37 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Why?
Thanks,
Brian Desmond
brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Michael B. Smith Sent: Tuesday, August 12, 2008 4:35 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Ensuring that you target the rid master. J
Regards,
Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brian Desmond Sent: Tuesday, August 12, 2008 5:32 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Adfind piped to admod will do it - there should be suitable examples in the usage.
Thanks,
Brian Desmond
brian@briandesmond.com
c - 312.731.3132
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 4:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
_____
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway.
_____
| | | |
| listmail
Posts:463
 | | 08/13/2008 10:59 AM |
| So to restate your problem, you want to move any computer that has the substring "DL" in the name from the computer container to some other OU?
You could do that with AdFind piped to AdMod with something like
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -unsafe
If you know that you have only 25 to move (which you can ascertain by running the command - adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dn) then you could do something like
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -safety 25
or
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -upto 25
so you don't accidently get too much of something else. Otherwise you can use the -unsafe and it will move everything the AdFind query matches on.
-- O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm
_____
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 5:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
_____
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway. _____
| | | |
| DhirajHaritwal
Posts:44
 | | 08/19/2008 4:13 AM |
| Hi Joe,
Thanks for your reply. I don't have much scripting knowledge. According to your suggestion I got a list of computers in excel which I want to move. Now kindly tell me how can I use this excel sheet in admod command. I want to move only these computers which are here in this Excel sheet.
Regards,
Dhiraj
_____
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe Sent: Wednesday, August 13, 2008 8:20 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
So to restate your problem, you want to move any computer that has the substring "DL" in the name from the computer container to some other OU?
You could do that with AdFind piped to AdMod with something like
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -unsafe
If you know that you have only 25 to move (which you can ascertain by running the command - adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dn) then you could do something like
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -safety 25
or
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -upto 25
so you don't accidently get too much of something else. Otherwise you can use the -unsafe and it will move everything the AdFind query matches on.
--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm
_____
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 5:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command
Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
_____
This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway.
_____
------------------------------------------------------------------- This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway. -------------------------------------------------------------------
| | | |
| ken
Posts:58
 | | 08/19/2008 4:26 AM |
| Um, the exact command you need to run is below in Joe's email.
Alternatively, if you really want to use your list in Excel, then paste that list into a text file (one computer per line) and so something like:
FOR /F "tokens=1*" %%i in (yourComputerList.txt) do call dsmove.exe "cn="%%1",dc=yourdomain,dc=local" -newparent "ou=newOU,dc=yourdomain,dc=local"
Cheers Ken
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, 19 August 2008 6:12 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
Hi Joe,
Thanks for your reply. I don't have much scripting knowledge. According to your suggestion I got a list of computers in excel which I want to move. Now kindly tell me how can I use this excel sheet in admod command. I want to move only these computers which are here in this Excel sheet.
Regards,
Dhiraj
________________________________ From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe Sent: Wednesday, August 13, 2008 8:20 PM To: ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Move Computer objects in an OU through Command
So to restate your problem, you want to move any computer that has the substring "DL" in the name from the computer container to some other OU?
You could do that with AdFind piped to AdMod with something like
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -unsafe
If you know that you have only 25 to move (which you can ascertain by running the command - adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dn) then you could do something like
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -safety 25
or
adfind -rb cn=computers -default -f "&(objectcategory=computer)(name=*dl*)" -dsq | admod -move ou=someou,dc=domain,dc=com -upto 25
so you don't accidently get too much of something else. Otherwise you can use the -unsafe and it will move everything the AdFind query matches on.
-- O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm
________________________________ From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Haritwal, Dhiraj Sent: Tuesday, August 12, 2008 5:24 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Move Computer objects in an OU through Command Hi,
We have all Computer objects in the Computer OU on the root domain. Now I want to move some Computer objects from Computer OU to a test OU whose name is containing DL ie. INSLLDLODEEPAK, INHRWDLOBRIAN. Kindly tell me how I can do this shifting with help of commands or any tool.
Regards,
Dhiraj
| | | |
|
|