Powershell script to create folder for groups with extensionAttribute1 set

Hi I want to write a powershell scrip that creates a folder for groups in a specific OU where I have set the extensionAttribute1.

Get-ADGroup -filter * -SearchBase "OU=Groups,OU=Test,DC=test,DC=Domain,DC=en" -properties * | where {$_.extensionAttribute1}| select-object samaccountname, extensionAttribute1

so I get the list of groups with extensionAttribute1 and with

Get-ChildItem D:\Test

I get the list of already created folders. What is the best way to compare these two lists and create one for the groups for which no folder is created yet?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum