I have a variable called $office
$Office = (get-aduser -Identity $Name -Properties * |select physicalDeliveryOfficeName).physicalDeliveryOfficeName
It produces results like this
01A;514;295;632;428;485;442;277;800;175
Of course it could be shorter or longer depending on how many locations the user is in.
Each location code will ALWAYS be separated by a semicolon.
Is there a way to break that up and use each code between the semicolons as a string that I could then use a foreach statement?
Thanks