PowerShell : Get COMPUTER objects of a specific group ( this example gets the properties “description” of each object )

PowerShell : Get COMPUTER objects of a specific group ( this example gets the properties “description” of each object )

# Get COMPUTER objects of a specific group ( this example gets the properties “description” of each object ) 
# List in a table format Name and Computer Description Properties

Get-AdGroupMember GROUPNAME | ForEach-Object {
$Computer = ($_.Name)
foreach ($c in $Computer) {
Get-ADComputer $c -Properties Description | ft name, description
}
}

# Expected Output
#Name Descriptions
#----- -------------
#Computername Computer Description
#Computername Computer Description
#Computername Computer Description

Steve

Comments are closed.
Secured By miniOrange