top of page

PowerShell - Quickly discover text list of servers OS

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 10, 2022
  • 1 min read

Save as a .ps1, or copy and paste, add all server names to discover OS as well if in evaluation mode is displayed. Quickly parses Operation Systems when dealing with Large lists.


#Create c:\temp\computers.txt and place server names top to bottom "not fqdn" and make certain no spaces behind names


#If Not on a DC run 'Import-Module ActiveDirectory' from a same Domain management box.


$Computers = Import-CSV -Path "c:\temp\computers.txt" -Header "Name"

ForEach ($Computer In $Computers)

{

Try

{

Get-ADComputer -Identity $Computer.Name -Properties Name, operatingSystem | Select Name, operatingSystem

}

Catch

{

$Computer.Name + " Server is not on this Domain, is vaulted, or is not reachable"

}

}



 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page