Get All AD Computer information - POWERSHELL

This script will gather all computer information to a file that can be used to audit the computers on your network.

<p>Get All AD Computer information - POWERSHELL</p>

Auditing computers on your network is not easy, but here is a PowerShell script that may help.  Right now it outputs to a text file, but there is no reason you could not adapt this to send an email, update a database, or even better, log to an external system. This script is designed to help small network admins take full control of the computers that they have to manage.  I use this at home to manage all my local computers!  Great for keping your wife and kids out of trouble.

 

function ComputerInformation ($computer)
{

Write-Output("Computer: ", $computer)
if(Test-Connection $computer -Count 1 -Quiet)
{
    Get-WmiObject -Class Win32_Processor -ComputerName $computer -ErrorAction SilentlyContinue
    Get-WmiObject -Class Win32_BIOS -ComputerName $computer -ErrorAction SilentlyContinue
    Get-WmiObject -Class Win32_OperatingSystem -ComputerName $computer -ErrorAction SilentlyContinue
    Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3" -ComputerName $computer -ErrorAction SilentlyContinue
}
else
{
Write-Output("Offline......")
}

}
function GetAllComputers()
{
    $comps = Get-ADComputer -Filter * -Property *
    foreach($comp in $comps)
    {
        ComputerInformation($comp.Name)
    }
}



GetAllComputers | Out-File "c:\users\TEST\test.txt"
Last Updated: 12/23/2016 3:24:33 PM