pbourne
(Bournestar)
1
Description
This script will return the member objects of an AD group. Useful when you want to run another script against a bunch of servers.
example
my-function (get-servers production)
Source Code
function Get-Servers {
param
(
[parameter(Mandatory=$true)]
[string[]]
$zones
)
Get-ADcomputer -Filter * -SearchBase "ou=$zones,ou=servers,dc=yourdomain,dc=net" | ForEach-Object {$_.DNSHostName}
}