Hello All,
I am working on a script to add the master OU name only to the users extensionAttribute8 but i failed to do this.
e.g. I have these users distinguishedName
1- CN=user1,OU=10289,OU=Students,DC=mydomain,DC=com
2- CN=user2,OU=10335,OU=Staff,DC=mydomain,DC=com
3- CN=user3,OU=Teachers,DC=mydomain,DC=com
so how can I have the OU after DC=mydomain,DC=com (from right) whatever the user exist on any child OU
for example i need for the first user1 to add Student word as a value to extensionattribute8
and for user2 to add staff word as a value to extensionattribute8
and for user3 to add Teachers word as a value to extensionattribute8
thanks a lot in advance