Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Create menu using results from cmdlet

$
0
0

I’m trying to build a semi-recursive menu, and I feel that powershell would be simple enough to maintain, once it’s built.

I would like to be able to query a list of child OUs from AD, easy enough.

 Get-ADOrganizationalUnit -searchbase "OU=folder,DC=domain,DC=com" -filter * -SearchScope onelevel | ft name,distinguishedname 

I would like to put this into a menu, selectable by the user, like:

 1. Human Resources 2. Finance 3. Facilities 

Then cycle back, set the searchbase to the DN of the above selected, and populate a new menu:

 1. Computers 2. Laptops 3. Servers 

Once I’m past this point, it’s easy enough to continue to drill down further into the OU structure, about 30 minutes of searching menus and arrays and functions has left my brain as scrambled eggs, with cheese.

Any ideas on how to accomplish this?

submitted by /u/DigitalDeity_
[link] [comments]

The post Create menu using results from cmdlet appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images