Thursday, April 2, 2015

Find the Service Tags of all Computers in your environment using Powershell and bat



Log into the domain controller or a workstation which has Active Directory Powershell module

Run the following command to create a list of computers in your environment

Get-ADComputer -Filter * |ft Name |Out-File computers.txt

Open notepad and create a bat file with the wmic call parsing the newly created computer text file.

wmic /NODE:@"c:\scripts\computers.txt"

bios get serialnumber > serialnumbers.txt

Execute the bat

No comments:

Post a Comment