header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
capturing the results of remove-adcomputer
Last Post 20 May 2011 06:05 AM by uSlackr. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
uSlackrUser is Offline
New Member
New Member
Posts:68
Avatar

--
20 May 2011 06:05 AM
    I'm looking to build our process to around cleanup of old AD computer objects. I'm looking to reun a script that uses Get-ADComputer to locate the old accounts and pipes them to remove-ADComputer.  I would like to capture the actions of the script. 

    more....
    We mark certain computer accounts (for our NetApp and others) with "Prevent from Accidental Deletion" checked, which Powershell respects (of course, as it is a permissions change).  So if I run the script, some accounts will fail deletion.  I would like to know which accounts fail as well.

    So here's the rub.  Remove-ADComputer doesn't pass out any objects as the result of its actions.  I understand this since the objects do not exist any longer.  So how do I go about capturing this list and the list of "errors". 

    My guess is we're not talking about a pipeline per se, but a script with a try catch fail statement.

    Thoughts?

    Thanks
    \\uSlackr
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer