简体   繁体   中英

Powershell script has to show all workstations ou in human readable format

I'm trying to write a script which takes some GPO and some OU and link or unlink between them. I am creating this in a GUI, where i have all the desired GPO on the left and the OU in the right. problem is, I want to show the user all the Workstation OUs which can be done easily by

Get-ADOrganizationalUnit -filter 'name -like "Workstations"' | ft distinguishedname

This is as close as I can get to making it human readable and the boss doesn't like that. I have thought about getting the path of each workstation so it will be shown as domain.local\office\workstations which is as close as i can get, but i cannot find any way to the the AD object the extract the path from it. I'm lost. Can anyone help me?

Im sorry that was pretty noob of me.

Get-ADOrganizationalUnit -Filter * -Properties CanonicalName | Select-Object -Property CanonicalName

omg

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM