-
-
Notifications
You must be signed in to change notification settings - Fork 32
Generating charts for dynamic data not working #64
Description
function Get-GPOPolicy
{
foreach ($gpo in $groupPolicies)
{
[xml]$xmlGPOReport = $gpo.generatereport('xml')
#GPO version
if (($xmlGPOReport.GPO.Computer.VersionDirectory -eq 0) -and ($xmlGPOReport.GPO.Computer.VersionSysvol -eq 0))
{
$computerSettings = "NeverModified"
}
else
{
$computerSettings = "Modified"
}
if (($xmlGPOReport.GPO.User.VersionDirectory -eq 0) -and ($xmlGPOReport.GPO.User.VersionSysvol -eq 0))
{
$userSettings = "NeverModified"
}
else
{
$userSettings = "Modified"
}
#GPO content
if ($null -eq $xmlGPOReport.GPO.User.ExtensionData)
{
$userSettingsConfigured = $false
}
else
{
$userSettingsConfigured = $true
}
if ($null -eq $xmlGPOReport.GPO.Computer.ExtensionData)
{
$computerSettingsConfigured = $false
}
else
{
$computerSettingsConfigured = $true
}
#Output
[PsCustomObject] @{
'Name' = $xmlGPOReport.GPO.Name
'Links' = $xmlGPOReport.GPO.LinksTo | Select-Object -ExpandProperty SOMPath
'Has Computer Settings' = $computerSettingsConfigured
'Has User Settings' = $userSettingsConfigured
'User Enabled' = $xmlGPOReport.GPO.User.Enabled
'Computer Enabled' = $xmlGPOReport.GPO.Computer.Enabled
'Computer Settings' = $computerSettings
'User Settings' = $userSettings
'Gpo Status' = $gpo.GpoStatus
'Creation Time' = $gpo.CreationTime
'Modification Time' = $gpo.ModificationTime
'WMI Filter' = $gpo.WmiFilter.name
'WMI Filter Description' = $gpo.WmiFilter.Description
'Path' = $gpo.Path
'GUID' = $gpo.Id
'ACLs' = $xmlGPOReport.GPO.SecurityDescriptor.Permissions.TrusteePermissions | ForEach-Object -Process {
New-Object -TypeName PSObject -Property @{
'User' = $_.trustee.name.'#Text'
'Permission Type' = $_.type.PermissionType
'Inherited' = $_.Inherited
'Permissions' = $_.Standard.GPOGroupedAccessEnum
}
}
}
}
}
$FilePath = "$Env:USERPROFILE\Desktop\PSWriteWord-Example-CreateCharts3.docx"
$WordDocument = New-WordDocument $FilePath
$lamy=Get-GPOPolicy
foreach($lama in $lamy)
{
}
Add-WordBarChart -WordDocument $WordDocument -ChartName 'My finances'-ChartLegendPosition Bottom -ChartLegendOverlay $false -ChartSeries $seria
#####################################################################################
Idea: MY AD have many GPO and i want to create chart where the value is number of ou where the gpo is pinned.
Problem: I dont because i cannot pass list of WordChart series into Add-WordBarChart, because it accepts only String[].