Created
May 20, 2016 12:53
-
-
Save ericjaystevens/ac65dc7495c5b54da7bfca9aa2a94eee to your computer and use it in GitHub Desktop.
Get information about all the Windows desktop computers in your environment that are connected to your Windows update server and export it to a csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires PoshWSUS | |
Import-Module PoshWSUS | |
$wsusServer = read-host -promt "enter WSUS server name" | |
Connect-PSWSUSServer $wsusServer -Port 80 | |
$pcs = Get-PSWSUSClient | Where-Object { -not ( $_.osdescription -like "Windows Server*" )} | |
foreach ($pc in $pcs) { | |
$pc | Add-Member -notepropertyname department -NotePropertyValue $($pc.requestedTargetGroupNames | select -First 1) | |
} | |
$pcs | select fulldomainName,make,model,osdescription,department | Export-Csv computerInventoryInfo.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment