Hi,
As far as I can see, even though active directory shows site information for domain controller’s, it doesnt have an attribute?
I have this function and just want to add the site information to the list view. Even if its as simple as if DC1 equals DC1, shows description as Default-First-Site-Name etc.
This works, but dont know where to start to pull the site info. Tried alsorts.
function updatedclist
{
$DCs = get-qadcomputer -SearchRoot 'domain/domain controllers'
$progress2.value = 20
if ($DCs.count){$progress2.step = (80/$DCs.count-1)}
else{$progress2.step = 80}
foreach($DC in $DCs){
$progress2.value += $progress2.step
$item2 = new-object System.Windows.Forms.ListViewItem($DC.name)
$item2.Tag = $DC
$list2.Items.Add($item2) > $null
} #End foreach
$progress2.visible = $false
$lbldc.visible = $true
$form2.Text = "Select Domain Controller"
} #End function updatedclist
#Save the initial state of the form
$InitialFormWindowState2 = $form2.WindowState
#Init the OnLoad event to correct the initial state of the form
$form2.add_Load($OnLoadForm_StateCorrection2)
$form2.add_Load({updatedclist})
#Show the Form
$form2.ShowDialog()| Out-Null
}
Thanks Dave