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?
Get-ADGroup, to the folder names returned byGet-ChildItem D:\Test? Then, create the folders based on which one's missing?