Invoke Best Practices Analyzer on remote computers

Script to invoke Best Practices Analyzer on remote computers.

 
 
 
 
 
(0)
Add to favorites
Operating System
8/17/2010
E-mail Twitter del.icio.us Digg Facebook
  • Get-ADComputer : The type initializer for 'Microsoft.ActiveDirectory.Management.ADObject' threw an exception. At c:\PSScripts\BPAv1.ps1.ps1:7 char:26 + $servers = Get-ADComputer <<<< -LDAPFilter "(OperatingSystem=*Windows Server 2008 R2*)" | select
    1 Posts | Last post March 14, 2014
    • I am getting this error message when trying to run the script:
      Get-ADComputer : The type initializer for 'Microsoft.ActiveDirectory.Management.ADObject' threw an exception.
      At c:\PSScripts\BPAv1.ps1.ps1:7 char:26
      + $servers = Get-ADComputer <<<<  -LDAPFilter "(OperatingSystem=*Windows Server 2008 R2*)" | select name,dnshostname
          + CategoryInfo          : NotSpecified: (:) [Get-ADComputer], TypeInitializationException
          + FullyQualifiedErrorId : The type initializer for 'Microsoft.ActiveDirectory.Management.ADObject' threw an except
         ion.,Microsoft.ActiveDirectory.Management.Commands.GetADComputer
      
      I have done research to try get the filter right but it will not go past this point.
      
      Any idea?
      
      Thanks