I am making a program with Delphi 2007 to import Active Directory users along with their OrganizationalUnit .
When I import a user, I need to get his OrganizationalUnit and then build tree for OrganizationalUnit and I need teh ogjectGUID for each OrganizationalUnit as well.
User "Kifah Najem" exists under OU Staff\Finance\A/C Payable as bellow distinguishedName
"CN=Kifah Najem,OU=A/C Payable,OU=Finance,OU=Staff,DC=kifah,DC=com,DC=sa"
So the result for OU should be as following
--------A/C Payable (OgjectGUID)
so this is a nested tree as it is in the Active directory, but for every entry I have the ObjectGUID.
I can run the query and get the distinguishedName, as well I can parse the distinguishedName and get all OUs from the distinguishedName, but how to get the ObjectGUID for every OU