Skip to content

Instantly share code, notes, and snippets.

PS C: \WINDOWS\system32> $OutputCollection | Where-Object {$_.Ownercount -eq 0} | Select-Object DisplayName
# Define a new object to gather output
$OutputCollection= @()
Write-Verbose "Getting Team Names and Details"
$teams = Get-Team
Write-Host "Teams Count is $($teams.count)"
$teams | ForEach-Object {