NOTE: The script assumes that windows is installed in C:\Windows on each server - you may need to change this in the script i.e.
dir "\\$server\c$\windows\assembly\gac_msil"
replace with
dir "\\$server\?$\windowsfolder?\assembly\gac_msil"
Script: check-assemblies.ps1
# Script to get assemblies from servers, and can be filtered for custom assemblies # Params # -ServerListFile : File containing a list of server names to check. One line per server. If not specified, local server will be checked # -filters : filter or array of filters, to filter on dlls to be return. For example, I could use the filters "*chris*.dll","*Lawes*.dll" param ($ServerListFile, $filters) # Get server list, depending on params - if not used, just check the local server if ($ServerListFile){ $Servers = Get-Content $ServerListFile } else{ $servers = $env:computername } foreach($server in $servers) { foreach ($filter in $filters) { dir "\\$server\c$\windows\assembly\gac_msil" -Recurse | where-object {$_.name -ilike $filter} | select @{n="Server";e={$server}}, Name, Length, LastwriteTime , @{n="Environment";e={$Environ}} } }
No comments:
Post a Comment