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
Avatar of tonelm54
tonelm54

ASKER

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
Avatar of oBdA
oBdA

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Powershell
Powershell

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

27K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo