Re: Scripting DSMOVE DSQUERY and DSMOD help! (EASY?)

From: name (nospam_at_user.com)
Date: 09/09/04


Date: Thu, 9 Sep 2004 06:10:41 -0400


Does your ng query take all words?

Or only those from the Ms dictionary.

=============================

I am afraid your sense of reality is confined to

insulated everyday monkey problems.

==============

"DUPLICATE"

Yep !

Your most profound word.

====

"Freddy Hartono" <freddy_hartono@removethis.non.agilent.com> wrote in
message news:%234uQx7hlEHA.3712@TK2MSFTNGP15.phx.gbl...
> Hi all,
>
> Im trying to create a batch file/vbs or whatever script that allows me to
> run these commands.
>
> Objective of script:
> To search the whole Active Directory for objects that are duplicated
(search
> condition $DUPLICATES*), mark them as disabled and move them to an OU.
>
> If i put these following commands into command prompt one by one it works,
> but not when i put it into .cmd or .bat (due to the for loop and the
> variables)
>
> for /F "usebackq delims=""" %i in (`dsquery * domainroot -filter
> "(&(objectCategory=*)(objectClass=*) (sAMAccountName=$DUPLICATE*))"`) do
> dsmod user %i -disabled yes
> for /F "usebackq delims=""" %i in (`dsquery * domainroot -filter
> "(&(objectCategory=*)(objectClass=*) (sAMAccountName=$DUPLICATE*))"`) do
> dsmove %i -newparent ou=scheduled,dc=YOURDOMAIN,dc=com
>
> if I use the default piping for dsquery and dsmod it works fine however if
i
> use dsquery piping with DSMOVE (if there are more than 1 objects to be
> moved) it failed! (crap)
>
> dsquery * domainroot -filter "(&(objectCategory=*)(objectClass=*)
> (sAMAccountName=$DUPLICATE*))" | dsmod user -disabled yes
> dsquery * domainroot -filter "(&(objectCategory=*)(objectClass=*)
> (sAMAccountName=$DUPLICATE*))" | dsmove -newparent
> ou=scheduled,dc=YOURDOMAIN,dc=com
>
> Anyone kind enough to mod this? :)
>
> Cheers!
>
> Kind Regards,
>
> Freddy Hartono
>
>



Relevant Pages

  • Re: Scripting DSMOVE DSQUERY and DSMOD help! (EASY?)
    ... "DUPLICATE" ... > Im trying to create a batch file/vbs or whatever script that allows me to ... > If i put these following commands into command prompt one by one it works, ... > Kind Regards, ...
    (microsoft.public.windows.server.scripting)
  • Re: Scripting DSMOVE DSQUERY and DSMOD help! (EASY?)
    ... "DUPLICATE" ... > Im trying to create a batch file/vbs or whatever script that allows me to ... > If i put these following commands into command prompt one by one it works, ... > Kind Regards, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Scripting DSMOVE DSQUERY and DSMOD help! (EASY?)
    ... "DUPLICATE" ... > Im trying to create a batch file/vbs or whatever script that allows me to ... > If i put these following commands into command prompt one by one it works, ... > Kind Regards, ...
    (microsoft.public.scripting.vbscript)
  • Re: Scripting DSMOVE DSQUERY and DSMOD help! (EASY?)
    ... > Im trying to create a batch file/vbs or whatever script that allows me to ... > run these commands. ... > Kind Regards, ...
    (microsoft.public.scripting.vbscript)
  • Re: Scripting DSMOVE DSQUERY and DSMOD help! (EASY?)
    ... > Im trying to create a batch file/vbs or whatever script that allows me to ... > run these commands. ... > Kind Regards, ...
    (microsoft.public.windows.server.scripting)