Admin Power Level: Intermediate Chapter 14: Set Rules Once, Apply Them Everywhere
Get a GPO and read its reports
Get-GPO lists policy objects. Get-GPOReport turns one into a readable report, and Get-GPResultantSetOfPolicy shows what actually applies to a user or computer, after all GPOs combine.
Lesson 1 of 2 in Chapter 14: Set Rules Once, Apply Them Everywhere. Previous step in this path: Create, modify, and enable firewall rules. 3 learning objectives, 9 examples, and a knowledge check.
Start: what you will learn
Get-GPO lists policy objects. Get-GPOReport turns one into a readable report, and Get-GPResultantSetOfPolicy shows what actually applies to a user or computer, after all GPOs combine.
Learning objectives
- List GPOs in a domain
- Generate a GPO report
- Explain resultant set of policy in plain words
Concept in simple words
What it is, from zero: a domain is a managed group of users and computers that share one directory. A Group Policy Object, usually shortened to GPO, is a bundle of settings stored in that domain. One GPO can hold rules for computers, rules for users, or both. Computer rules might control security settings or software behaviour on a machine. User rules might control the desktop or the software experience for a person who signs in. The GPO itself is not a program, and it is not a script that runs once and finishes. It is a standing set of rules that Windows reads again and again.
What lives inside a GPO: think of a GPO as having two connected parts. One part lives in the directory, and it holds the identity of the GPO, such as its name, its unique id, its status, and its version numbers. The other part holds the actual setting files. That split is why you can list a GPO quickly with Get-GPO, yet still need a report to see the settings inside it. Listing tells you that a bundle exists and whether it is switched on. It does not tell you what rules are inside the bundle.
Why it works
Why a GPO does nothing on its own: a GPO only affects users and computers when it is linked to a place in the domain. A link can point at a site, at the whole domain, or at an organisational unit, which is a container for users and computers. If a GPO is created but never linked, it sits in the domain doing nothing. If it is linked to one organisational unit, it does not reach users in a different organisational unit, unless that other unit sits below the linked unit and inherits the setting. So the first question is never only what a GPO contains. The first question is also where it is linked, and who sits under that link.
How several GPOs combine, in order: Windows processes GPOs in a fixed order, from local policy, then site, then domain, then organisational unit. A simple way to remember the order is LSDOU, which stands for Local, Site, Domain, Organisational Unit. A later GPO in that order can overwrite an earlier GPO when both set the same setting. That is why the GPO linked closest to the user or computer usually wins. At one single level, where several GPOs are linked to the same container, link order decides the winner, and the GPO with the highest priority at that level is processed last, so it wins a conflict.
Two twists that change the simple order: the first twist is Enforced. When a GPO link is marked Enforced, that GPO cannot be blocked by a lower container, and it wins conflicts even against GPOs linked closer to the user or computer. The second twist is Block Inheritance. When Block Inheritance is set on an organisational unit, GPOs from higher levels stop flowing down into that unit, except for GPOs that are Enforced. That is why two users in different units can get different results from the same domain policy, and why you must check inheritance before you declare a policy broken.
The two halves of a GPO, and what GpoStatus means: every GPO has a Computer Configuration side and a User Configuration side. Computer settings apply to machines, and user settings apply to people who sign in. The GpoStatus property tells you which sides are switched on. AllSettingsEnabled means both sides are enabled. AllSettingsDisabled means both sides are disabled, so the GPO does nothing even if it is linked. UserSettingsDisabled means only the computer side runs. ComputerSettingsDisabled means only the user side runs. A half disabled GPO is often deliberate, for example when a GPO only needs computer rules, so do not treat a half disabled status as an error on its own.
Filters that can quietly skip a GPO: linking is not the whole story. Security filtering controls which users, computers, or groups are allowed to read and apply a GPO. By default, a new GPO targets Authenticated Users, which covers users and computers in its linked scope, but an admin can narrow that list to one group. A WMI filter is different. It is a test that runs on the destination computer, and the GPO only continues when the test returns true. If either filter says no, the GPO is skipped for that user or computer, often with no visible error on screen. That quiet skip is one of the most common reasons a correct looking setting never appears.
Why a policy does not apply instantly: Windows applies computer policy when a computer starts, and user policy when a user signs in. After that first application, Windows refreshes policy in the background. By default, that background refresh happens every 90 minutes, plus a random delay of up to 30 minutes, so a change can take up to about two hours to reach a normal computer on its own. Domain controllers check much more often, about every five minutes. On top of that, a change made on one domain controller must first replicate to the domain controller that a client talks to. Some settings also only process at startup or sign in, such as software installation and folder redirection, so a background refresh alone will never apply them. A policy that has not arrived yet is not the same as a policy that is broken.
Report versus resultant set, and why you need both: a GPO report describes one GPO. It includes its details, its links, its security filtering, its WMI filtering, its delegation, and its computer and user configurations. It answers the question, what does this one bundle contain. The resultant set of policy, often shortened to RSoP, answers a different question, what finally applies to one user or computer after every linked GPO, filter, inheritance rule, and priority decision has combined. The report is about one ingredient. The resultant set is about the finished meal. When a setting surprises you, the resultant set is the evidence you trust, because it shows the winner, not just one candidate.
Think of it like this
Think of it like this: a stack of house rules from different people. One list says lights out at ten, another says lights out at eleven, and the final rule you actually follow depends on which list has priority for your room. A list that is not pinned to your door does not count, even if it looks official. A list that only applies to guests does not count for you. And a list that was changed an hour ago may not have reached your room yet. The resultant set is that final rule for your room, after every list, every pin, and every exception has been taken into account.
How it works, step by step
How it works, step by step, in order: First, list GPOs with Get-GPO -All and note the DisplayName and GpoStatus, which tells you whether a GPO is enabled, and whether one side is disabled. Second, pick one GPO and read its full details, including its Id, its DomainName, its CreationTime, its ModificationTime, and its WmiFilter, so you know exactly which bundle you are looking at. Third, make a report with Get-GPOReport, choosing Html for a report you can read in a browser, or XML for a report you can process further. Fourth, read the report sections for links, security filtering, WMI filtering, and the actual settings, and do not trust the GPO name alone. Fifth, when a setting does not apply as expected, run the resultant set for that user or computer. Sixth, compare what you expected with what the resultant set shows, and check link, inheritance, status, filtering, and timing, in that order, before you change anything.
Worked example 1, list GPOs: take Get-GPO -All | Select-Object DisplayName, GpoStatus -First 5. Get-GPO -All returns every GPO in the domain. The pipe sends those GPO objects to Select-Object, which keeps only the readable DisplayName and the GpoStatus. The -First 5 part limits the list to five rows, so you are not flooded on a large domain. Look for a GpoStatus of AllSettingsEnabled, which means the GPO is switched on, and watch for UserSettingsDisabled or ComputerSettingsDisabled, which mean only one side runs. If you change -First 5 to a larger number, you see more rows, but the meaning of each row stays the same. Note that this list alone does not mean a GPO applies to you, because it still has to be linked to your location in the domain, and it still has to pass its filters.
Worked example 2, read one GPO in detail: take Get-GPO -Name "Default Domain Policy". The -Name parameter picks one GPO by its display name, and the name must match exactly, including spaces and capital letters as stored. The output is one GPO object, with properties such as DisplayName, DomainName, Owner, Id, GpoStatus, Description, CreationTime, ModificationTime, UserVersion, ComputerVersion, and WmiFilter. Look at ModificationTime first when you wonder whether a recent change is in this GPO, and look at WmiFilter to see whether a filter is attached. If you swap -Name for -Guid and give the Id value instead, you get the same GPO, but you avoid any confusion when two GPOs have similar names. If you get no result, check the spelling of the name before you assume the GPO is missing.
Worked example 3, find disabled GPOs: take Get-GPO -All | Where-Object { $_.GpoStatus -eq "AllSettingsDisabled" } | Select-Object DisplayName. Get-GPO -All returns every GPO. Where-Object keeps only the objects where the GpoStatus property equals AllSettingsDisabled. The $_ symbol means the current object moving through the pipe, so $_.GpoStatus reads the status of each GPO in turn. Select-Object then keeps only the DisplayName, so the result is a clean list of fully disabled GPOs. This is a useful hygiene check, because a disabled GPO linked to an important unit explains a missing setting at once. If you change the comparison to UserSettingsDisabled, the same pattern lists GPOs whose user side is off, which is a different and narrower question.
Worked example 4, make a readable HTML report: take Get-GPOReport -Name "Default Domain Policy" -ReportType Html -Path "C:\Reports\gpo.html". The -Name parameter picks the GPO. The -ReportType parameter picks the format, and Html means a report you can open in a browser and read by eye. The -Path parameter gives the file where the report is saved. Make sure the C:\Reports folder already exists before you run it, and keep the file name tied to the GPO, so you can find it again later. Open the file and read the settings section, the links section, and the filtering sections, in that order. If you change Html to Xml, you get the same information in a machine readable form, but it is much harder to read by eye, so use Xml only when a script or a search will process it.
Worked example 5, make an XML report for processing: take Get-GPOReport -Name "Default Domain Policy" -ReportType Xml -Path "C:\Reports\gpo.xml". Every part works the same way as the HTML example, except -ReportType Xml changes the format. The settings do not change, only the shape of the file changes. XML is useful when you want to search many GPOs for one setting, or feed a report into another tool, because a script can read structured XML reliably. Do not open a large XML report and try to read it like a web page. If a person needs to read it, go back to Html. If you leave out -Path entirely, Get-GPOReport prints the report to the display instead of writing a file, which is fine for a quick look, but hard to search or keep.
Worked example 6, report on every GPO at once: take Get-GPOReport -All -ReportType Html -Path "C:\Reports\all-gpos.html". The -All switch replaces -Name, and it means generate a report for every GPO in the domain, in one combined file. This is the right choice for an audit or for a full backup of what the domain contains, because you capture everything in one place. It is the wrong choice for troubleshooting one user, because the file will be long, and the GPO you care about will be buried among many others. When you use -All, expect a large file, save it with a date in the name or in a dated folder, and search inside it for the GPO name you need, rather than reading it from top to bottom.
Worked example 7, resultant set for one user: take Get-GPResultantSetOfPolicy -User "example\izaz" -ReportType Html -Path "C:\Reports\rsop.html". The -User parameter names the user, in domain and username form, with a backslash between the domain and the username. The -ReportType parameter asks for a readable HTML report, and -Path gives the file where the report is saved, using the same report pattern as the GPO report examples in this lesson. In the report, look first at the list of applied GPOs, then at any list of GPOs that were denied or filtered out, and then at the winning setting for the area you are checking. If you change the username, you get a different answer, because the resultant set is personal to that user and that computer context. A mistyped username gives you an empty or unhelpful result, so spell the name exactly, and check it against the directory when the result looks wrong.
Worked example 8, resultant set for the current session: take Get-GPResultantSetOfPolicy -ReportType Html -Path "C:\Reports\rsop-local.html". This version leaves out -User and -Computer, so it builds the report for the user and computer in the current session. That makes it the quickest sanity check on your own machine, because you do not need to type a name or a computer name at all. The trade off is that it answers only for the current session. If you need to check a different user, or a different computer, you must add -User or -Computer, as in the previous example. If the report shows a setting you did not expect, go back to the GPO report for the winning GPO, and read its links and filters, rather than editing the first GPO whose name looks related.
Worked example 9, a quick check with gpresult: take gpresult /r. This is not a PowerShell cmdlet, it is the built in Windows tool for the same final result, and /r asks for a summary. It shows the applied GPOs for the computer and for the user, and it also shows GPOs that were not applied because they were filtered out, with reasons such as Denied for security, Disabled, or Empty. Use gpresult /r when you are sitting at the affected computer and you want a fast answer without writing a file. Use Get-GPResultantSetOfPolicy when you want a saved HTML report you can keep, share, or compare later. If gpresult /r and the PowerShell report disagree, check that you ran both for the same user and the same computer, because that mismatch is usually a targeting mistake, not a tool fault.
When to use it
When to use it, and when not to: use a list when you need an overview, use a report when you need to know what one GPO really contains, and use the resultant set when a setting surprises you. Do not assume a GPO applies just because it exists, and do not assume its contents from its name, because names are written by people and can be vague or out of date. Do not edit a GPO just because a report looks odd. Check first whether that GPO is even linked to the user or computer in question, whether its status disables the side you need, whether a filter excludes that user or computer, and whether enough time has passed for the change to replicate and refresh. Editing the wrong GPO fixes nothing, and it creates a new change you must then undo.
Safety note for this lesson: the commands in this lesson only read and report. They do not change a GPO. Even so, work only in your own domain and lab, and only with permission to read those GPOs. If a command reports that access is denied, stop and ask the person who manages that domain, rather than trying a different account or a workaround. Reading a report is safe, but using what you learn to change a shared policy without permission is not, and that change step belongs in the next lesson, with a backup first.
Worked examples
Read each example in order. Each one explains its parts, then shows what to look for in the output.
Syntax
Get-GPO | Get-GPOReport -ReportType Html -Path <Path>Example 1
Lists GPOs with their status, so you can see which ones are enabled, which are fully disabled, and which have only one side enabled.
Get-GPO -All | Select-Object DisplayName, GpoStatus -First 5Illustrative output: DisplayName GpoStatus ----------- --------- Default Domain Policy AllSettingsEnabled
Example 2
Reads one GPO by its exact display name, so you can check its Id, domain, status, creation and modification times, version numbers, and any WMI filter.
Get-GPO -Name "Default Domain Policy"Illustrative output: DisplayName : Default Domain Policy DomainName : example.local GpoStatus : AllSettingsEnabled WmiFilter :
Example 3
Keeps only fully disabled GPOs, so a linked but disabled GPO shows up at once as a possible reason for a missing setting.
Get-GPO -All | Where-Object { $_.GpoStatus -eq "AllSettingsDisabled" } | Select-Object DisplayNameIllustrative output: DisplayName ----------- Old Test Policy
Example 4
Writes a readable HTML report of one GPO to a file you can open in a browser, including its links, filtering, and settings.
Get-GPOReport -Name "Default Domain Policy" -ReportType Html -Path "C:\Reports\gpo.html"Illustrative output: Report written to C:\Reports\gpo.html.
Example 5
Writes the same GPO report in XML form, which is harder to read by eye but easier for a script to search and process.
Get-GPOReport -Name "Default Domain Policy" -ReportType Xml -Path "C:\Reports\gpo.xml"Illustrative output: Report written to C:\Reports\gpo.xml.
Example 6
Writes one combined HTML report for every GPO in the domain, which suits an audit, but is too long for troubleshooting one user.
Get-GPOReport -All -ReportType Html -Path "C:\Reports\all-gpos.html"Illustrative output: Report written to C:\Reports\all-gpos.html.
Example 7
Get-GPResultantSetOfPolicy builds the final policy result for one user. -User names that user, in domain and username form. -ReportType Html asks for a readable report, and -Path gives the file where the report is saved, using the same report pattern as the GPO report example in the lesson.
Get-GPResultantSetOfPolicy -User "example\izaz" -ReportType Html -Path "C:\Reports\rsop.html"Illustrative output: Report written to C:\Reports\rsop.html.
Example 8
Builds the resultant set for the current user and computer, with no -User or -Computer given, which makes it the quickest check on your own machine.
Get-GPResultantSetOfPolicy -ReportType Html -Path "C:\Reports\rsop-local.html"Illustrative output: Report written to C:\Reports\rsop-local.html.
Example 9
Shows a quick summary of applied GPOs and GPOs filtered out for the current user and computer, without writing a file.
gpresult /rIllustrative output: Applied Group Policy Objects ------------------------------ Default Domain Policy
Nothing on this page executes PowerShell code. The outputs above are illustrative only.
Common mistakes and troubleshooting
Read these before you try the examples, so you can spot the same problems in your own work.
- Assuming a GPO applies because it exists. Only linked GPOs affect objects, and filters and inheritance still apply.
- Reading a GPO name and assuming its contents. Generate the report and read the actual settings, including links and filtering.
- Running the resultant set for a mistyped username, getting an empty or unhelpful result, and concluding that no policy applies, when the real problem was the spelling of the name.
- Seeing UserSettingsDisabled or ComputerSettingsDisabled and treating it as a fault, when it often means only one side of the GPO was meant to run, so the missing settings were never on that side.
- Confusing a GPO report with a resultant set. The report shows one GPO, while the resultant set shows the final winner for one user or computer, and only the second one settles a conflict.
- Checking policy seconds after a change and concluding it failed, when the change may still need to replicate to the right domain controller and wait for the next background refresh, or for a sign in or restart.
- Running a report for every GPO with -All when you only need one user answer, then getting lost in a long file instead of reading the resultant set for that user.
- Saving a report to a folder that does not exist, or to a vague file name you cannot find later, and then running the same commands again instead of checking the folder and the file name first.
Knowledge check
Knowledge check
What does resultant set of policy show?
Pick one answer. Feedback appears right away, and you can try again.
Remember this and next step
Remember this: list first, report second, resultant set third. The name tells you what someone called it, the report tells you what one GPO contains, including its links and filters, and the resultant set tells you what actually applies to one user or computer after order, inheritance, enforcement, filtering, and timing have all had their say. When a setting confuses you, do not guess, and do not edit on a hunch. List, read, check the final result, and only then decide what, if anything, needs to change.
Next step: Back up, restore, and refresh a GPO