Hi, when I try to output the edmpolicy property from a AD Group the output is incomplete in a listbox. It should look like this {+SOFTWARE/75_MS_VS_CPLUSPLUS_2K8_SP1, +SOFTWARE/APP50_VMWAREPLUGIN6_041416} but it only shows +SOFTWARE/APP50_VMWAREPLUGIN6_041416. Is it some formatting I’m missing? Is it possible to remove the +SOFTWARE/ output also? Thanks for any help in advance.
$buttonViewZService_Click= {
#TODO: Place custom script here
$vbmsg = new-object -comobject wscript.shell
if ($list2.selecteditems.count -gt 1) { $vbmsg1 = $vbmsg.popup("You may only select one Group at a time.", 0, "Error", 0) }
elseif ($list2.selecteditems.count -lt 1) { $vbmsg1 = $vbmsg.popup("Please select an Group to view.", 0, "Error", 0) }
else
{
$exprString = '$list2.SelectedItems | foreach-object {$_.tag} | foreach-object {$_.name}'
$endapp = invoke-expression $exprString
import-module activedirectory
$list1.visible = $true
$columnnames = "Name", "Path"
$list1.Columns[1].text = "Install Date"
$list1.Columns[1].width = 129
$list1.Columns[0].text = "Name"
$list1.Columns[0].width = ($list1.width - $list1.columns[1].width - 25)
$list1.items.Clear()
$systeminfoerror = $null
import-module activedirectory
$software = Get-ADgroup -LDAPFilter "(&(Name=$endapp))" -Property *
$columnproperties = "Name"
foreach ($app in $software)
{
$item = new-object System.Windows.Forms.ListViewItem($app.edmPolicy)
if ($app.InstallDate -ne $null)
{
$item.SubItems.Add($app.Result)
}
$item.Tag = $app
$list1.Items.Add($item) > $null
}
}
}