Spread the word.

Share the link on social media.

Share
  • Facebook
Have an account? Sign In Now

Sign Up

Create your WindowsTechno Community account. It’s free and only takes a minute.

Have an account? Sign In
Continue with Facebook
Continue with Google
or use

Have an account? Sign In Now

Sign In

Continue with Facebook
Continue with Google
or use

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Continue with Facebook
Continue with Google
or use

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

WindowsTechno Community

WindowsTechno Community Logo WindowsTechno Community Logo

WindowsTechno Community Navigation

  • Home
  • About Us
  • Write For Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Write For Us
Home/ Questions/Q 1131
Next
In Process
Vipan Kumar
  • 2
Vipan Kumar
Asked: February 21, 20232023-02-21T19:32:38+05:30 2023-02-21T19:32:38+05:30In: Group Policy

Sharing knowledge to find out the orphaned GPO in Active directory

  • 2

What is Orphaned GPOs??

Orphaned GPOs are objects that are deleted from GMPC console but for different reasons, their corresponding folder is not removed. So in this case the folder remains in SYSVOL folder, however there is no GPO associated to it.

How to find out these via powershell script.

This script fetch the Orphaned GPOs of your domain environment then you can just check these GUIDs in group policy for double cross whether these are linked with any of group policy or not. then please proceed for further action.

Please let us know if you guys need step by step plan for Orphaned GPOs removal

=========================================================

Just put your domain name in “yourdomainhere.local”

=========================================================

$domain = “yourdomainhere.local”

$gpoGuids = @()
$sysvolGuids = @()
$gpoGuids = Get-GPO -All -Domain $domain | Select-Object @{ n=’GUID’; e = {$_.Id.ToString()}} | Select-Object -ExpandProperty GUID
$polPath = “\\\\$domain\\SYSVOL\\$domain\\Policies”
$polFolders = Get-ChildItem $polPath -Exclude ‘PolicyDefinitions’ | Select-Object -ExpandProperty name
foreach ($folder in $polFolders)
{
$sysvolGuids += $folder -replace ‘{|}’, “”
}
Compare-Object -ReferenceObject $sysvolGuids -DifferenceObject $gpoGuids | Select-Object -ExpandProperty InputObject

=========================================================

Thank You !!

Vipan

  • 1 1 Answer
  • 78 Views
  • 0 Followers
  • 1
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Facebook
    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Facebook
    Continue with Google

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. [Deleted User]
      2023-02-21T19:50:17+05:30Added an answer on February 21, 2023 at 7:50 pm

      Thank you for this , if possible please add the steps as well.

      • 1
      • Reply
      • Share
        Share
        • Share onFacebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Sidebar

    Ask A Question

    Stats

    • Questions : 119
    • Answers : 26
    • Posts : 15
    • Comment : 1
    • Best Answers : 4
    • Users : 8
    • Groups : 2
    • Group Posts : 0
    • Popular
    • Comments
    • Tags
    • Vipan Kumar

      DFSR no longer replicates files

      • 1 Comment
    • Vipan Kumar

      Wintel Administrator Interview Questions

      • 0 Comments
    • Vipan Kumar

      What is Active Directory?

      • 0 Comments
    • Vipan Kumar

      Active Directory Domain Services Overview

      • 0 Comments
    • Vipan Kumar

      How to fix the issue with the slow authentication

      • 0 Comments
    • Manoj
      Manoj added a comment Nice explanation ? February 4, 2023 at 11:21 am

    Users

    Shawn Davis

    Shawn Davis

    • 0 Questions
    • 0 Answers
    Manoj Kumar

    Manoj Kumar

    • 0 Questions
    • 0 Answers
    Vipan Thakur

    Vipan Thakur

    • 0 Questions
    • 0 Answers

    Explore

    • Home
    • Questions

    Footer

    © 2023 WindowsTechno. All Rights Reserved
    by WindowsTechno.