Please help me with the script below:
searchOU='ou=DYCD-Servers,dc=dycd,dc=nycnet'
$file = Get-Content C:\scripts\Servers.txt
Get-ADComputer -filter * -SearchBase $searchOU |
Foreach-($server in $file{
$group = $[ADSI]"WinNT://$($_.'WinNT)/(Administrators".psbase.invoke('Members') |
ForEach-Object {
$user = $_.GetType().InvokeMember('Name', 'GetProperty', $null, $_, $null)
New-Object 'PSObject' -property @{'Server'=$server; 'Admin'=$user}
}
}