Re: Delete computer objects more than 5 weeks old...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: David Doumani (ddoumani_at_verizon.net)
Date: 12/22/04


Date: Wed, 22 Dec 2004 15:02:42 -0500

Thanks for that info - but it leads me to another question. When I write a
query in the AD Users and Computers console for all user accounts older than
90 days; it's consistent regardless which DC I connect to - even though the
information is not replicated - does that imply a query in the console
check's all DC's? I know my original question was regarding computer
accounts and the script can be modified but I am curious to know; or if
someone knows; why the 90-day query is always consistent... it's can't be
polling all the DC's as fast as the results are coming up...

I'll try to modify the link below to dump computers vs. users.

Thanks

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:eBJMbDF6EHA.1452@TK2MSFTNGP11.phx.gbl...
> David Doumani wrote:
>
>> We are going thru a pc-refresh that is leaving "orphaned" objects in our
>> directory... currently I dsquery for all computers inactive for 5 weeks;
>> pipe them to a cmd file and throw a dsrm in front and a -noprompt at the
>> end. We are making the assumption that if the machine has not updated
>> its password in 5 weeks then is no longer around - we've been doing this
>> for a few months now and it works out ok - but I've attempted to write a
>> script to do the same thing to reduce the having to create .cmd files,
>> etc... does anyone have anything that I can use as a model to create
>> this functionality? "dsquery computer -inactive 5 | dsrm" doesn't work as
>> it says in the help file, just brings up the dsrm help file.
> Hi
>
> Last Logon Dates
> http://www.rlmueller.net/Last%20Logon.htm
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx



Relevant Pages

  • Re: Delete computer objects more than 5 weeks old...
    ... query in the AD Users and Computers console for all user accounts older than ... I'll try to modify the link below to dump computers vs. users. ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: Delete computer objects more than 5 weeks old...
    ... > query in the AD Users and Computers console for all user accounts older ... account was created - and that date is replicated once only, ... >> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: Delete computer objects more than 5 weeks old...
    ... > query in the AD Users and Computers console for all user accounts older ... account was created - and that date is replicated once only, ... >> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.wsh)
  • Re: Distribute to user account objects in specific AD group in SCC
    ... For your second query, perhaps try using the subselect 'not in' ... This gave me a list of all the computers in the AD group. ... It does NOT work the same way as users in a usergroup. ... problem upon removing the computer account from the AD group and invoking ...
    (microsoft.public.sms.admin)
  • Re: Access to a custom table
    ... Create a collection based on this query for machines you want to include: ... "Tony" wrote: ... Let say I have computers named "A, B, C, D" in the database. ... > that has the NOT subselect query. ...
    (microsoft.public.sms.admin)