Register
: :
Login
Home
Forums
Blogs
Podcast
Directories
Scripts
Downloads
Community
User Group Support
Learning Resources
We have a new sponsor! Introducting
Pragma Systems
. See the home page for details.
Unanswered
Active Topics
Forums
Search
Members
Forums
>
Using PowerShell
>
General PowerShell
Remove a .dll from workstations in a domain.
Last Post 10 Feb 2010 08:50 PM by
jkavanagh58
. 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
07 Feb 2010 02:22 AM
I want to remove a .dll from workstations in a domain. Is this possible?
PowerShellJedi
Basic Member
Posts:298
10 Feb 2010 08: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" ;-)
Innotask Technologies
Tech Support for small & mid sized companies.
PowerShellJedi
Basic Member
Posts:298
10 Feb 2010 08: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" ;-)
Innotask Technologies
Tech Support for small & mid sized companies.
jkavanagh58
New Member
Posts:59
10 Feb 2010 08: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.
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
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
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.1
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008