I am trying to go through a loop and create a grid that will display all the users found in AD with a couple values such as name, username, password last set and when password expires but i only getting everything on one line.
$ActiveDirectory = New-UDPage -Name "Active Directory" -Icon link -Content {
$aduser = Get-ADUser -Filter * -Properties *
$Data = @(
@{
Name="$($aduser.Name)"
Username="$($aduser.samaccountname)"
Password_last_Set="$($aduser.Passwordlastset)"
Password_Expires="$($aduser.passwordlastset)"
}
)
$data | ForEach-Object {
New-UDGrid -Title 'Active Directory Users' -Headers @("Name", "Username", "Password Last Set", "Password Expires") -Properties @("Name", "Username", "Password_last_Set", "Password_Expires") -Endpoint {
$Data | Out-UDGridData
}
}
}