Hi
I am having a challenge whit the following script:
$Header = @"
<style>
h1 {
font-family: Arial, Helvetica, sans-serif;
color: #000099;
font-size: 28px;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
color: #000099;
font-size: 16px;
}
table {
font-size: 12px;
border: 0px;
font-family: Arial, Helvetica, sans-serif;
}
td {
padding: 4px;
margin: 0px;
border: 0;
}
th {
background: #395870;
background: linear-gradient(#49708f, #293f50);
color: #fff;
font-size: 11px;
text-transform: uppercase;
padding: 10px 15px;
vertical-align: middle;
}
tbody tr:nth-child(even) {
background: #f0f0f2;
}
#CreationDate {
font-family: Arial, Helvetica, sans-serif;
color: #ff3300;
font-size: 12px;
}
</style>
"@
$RaportTitel = "<h1>Rechten </h1>"
$AanmaakDatum = "<p>Aanmaak Datum: $(Get-Date -format yyyy-MM-dd)</p>"
$SearchBase = "OU=,OU=,OU=,DC=,DC="
$Groups = Get-ADGroup -Filter * -SearchBase $Searchbase -Properties Name, members
$Results = foreach( $Group in $Groups ){
Get-ADGroupMember -Identity $Group | ForEach-Object {
[pscustomobject]@{
GroupName = $Group.Name
Name = $_.Name
}}}
$Results | Select-Object GroupName, Name | ConvertTo-Html -Property GroupName, Name -fragment -PreContent "<h2>test</h2>"
$Report = ConvertTo-HTML -Body "$RaportTitel $AanmaakDatum $Results" -Title $RaportTitel -Head $Header
$Report | Out-File "Pathl"
When running de script. On the commanline I see that the table is generated. but when I open the report.html I dont''t see the the table.
greetings
Roel Knippen