Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
Active Directory
capturing the results of remove-adcomputer
Last Post 20 May 2011 06:05 AM by
uSlackr
. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
uSlackr
New Member
Posts:68
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.
Using PowerShell
--General PowerShell
--Active Directory
--Exchange Server
--Lync Server
--SharePoint
--SQL Server
--System Center
--Non-Microsoft Products
--Books, Tools, and Videos
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
Active Directory
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2