Avatar of tonelm54
tonelm54 asked on

Registry - Looks at sub folders and extract keys all to an array

Is it possible to go inside a registry folder, and under each sub-folder list out some values?


I want to be able to list all the Sharepoint URLs that are being synced on a PC, so I found in the registry they are stored in "HKEY_CURRENT_USER\SOFTWARE\SyncEngines\Providers\OneDrive\". However there is a GUID folder for each one, and inside each one there are a few keys I want to extract (MountPoint and UrlNamespace).


Is there a powershell script that I can use to go through each folder and where each sub-folder has "LibraryType"= "teamsite" for it to return an array of MountPoint and UrlNamespace and when completed I should have an array with all my sharepoint sites that I sync with their name and URL.


Thank you in advance

Powershell

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
ASKER
tonelm54

Ive had a relook at this, and come up with
Get-ChildItem "HKCU:\SOFTWARE\SyncEngines\Providers\OneDrive\" -Recurse | ForEach-Object {
    if ($_.LibraryType -eq "teamsite") {
        $_.UrlNamespace
    }
}

Open in new window

However I its not displaying anything. If I use:-
Get-ChildItem "HKCU:\SOFTWARE\SyncEngines\Providers\OneDrive\" -Recurse | ForEach-Object {
        $_.UrlNamespace
}

Open in new window

I am getting a table out:-
Name      Property

So, Im assuming I need to somehow break into each folder somehow (which I thought the ForEach did)
ASKER CERTIFIED SOLUTION
oBdA

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61