Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Remove a .dll from workstations in a domain.
Last Post 10 Feb 2010 12:50 PM by
JKav
. 3 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
kilger
New Member
Posts:3
06 Feb 2010 06:22 PM
I want to remove a .dll from workstations in a domain. Is this possible?
PowerShell Jedi
Basic Member
Posts:410
10 Feb 2010 12:09 PM
Yes... 99.9% of things are possible with Powershell.
$Computers = Get-Content C:\Computers.txt
$Computers | ForEach-Object{
[string]$FilePath = "\\$_\c$\Path\To\Dll.dll"
$DLLExsists = Test-Path $FilePath
if($DLLExsists -eq $true){Remove-Item $FilePath -Force}
}# ForEach-Obj...
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
PowerShell Jedi
Basic Member
Posts:410
10 Feb 2010 12:23 PM
That is the simplest form of a script to do what you ask.
You may want to ping each machine before attempting to do other things to if because the ping timeout is shorter than the error "RPC Server unavailable" and it will reduce error for when you come to a machine that is not on or otherwise unreachable.
Also it is possible to get a list of computer names directly from Active Directory in Powershell. You should be able to search this forum to find examples of this.
Basically, your going to have invest some time into Powershell to get the best results. But.. YES it is possible.
PoSH is a Automation Technology surfaced as a scripting language, not a "spice" ;-)
JKav
New Member
Posts:70
10 Feb 2010 12:50 PM
I would use test-connection -quiet -count 1 versus a ping as it will return issues such as "lack of resources" . However the RPC issue might not be caught, I just mention that because I am seeing issues where test-connection works but gwmi fails (still trying to figure out why, in some cases it is a DMZ but other cases I have been told the end point machine has been modified so that RPC uses custom ports).
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--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
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2