((Get-ADUser UserID -Properties memberof).memberof | Get-ADGroup | Where-Object {$_.name -like "APP*"}).name | Sort-Object
But this also proved too cumbersome or complex. This left me with one choice and that was to dumb it down as much as I could think of. The result is this
Enter the user's Samaccountname in the little box and click the button.
If this isn't easy enough I don't know what is.Now, about the script that does this.
I've never done a GUI interface for PowerShell so of couse I looked to Google. What I found was a plethora of references to Sapien's PrimalForms CE. What I also found was that Sapien discontinued the product and removed it from all download sites :(
Instead of wasting more time and possibly money to find another forms/GUI editor/builder, I started piecing things together from the different examples of the code generated by these types of products. All I have to say is thank goodness I can make heads or tails of what I found. Now, I'm sure there is extra unneeded code in here, I'm just not anal enough to go in line by line to see what it works without right now. I have a functional tool that serves my purpose.
Oh wait, there's more. After a little trial and error with my target audience, an interesting development has come to light. Even this isn't easy enough. No, why you might ask? Because it requires them to:
1. Open PowerShell
2. Type the path and script name.
3. Press Enter
How dare I think they should have to do that! So how do we make this easy enough for even the untrained Monkey?
We make it so they can just click on something and not have any of those distracting and scary black or blue boxes pop up. Enter the command file and shortcut:
powershell -noprofile -Noninteractive -command \\%ScriptLocation%\Get-AppGroups.ps1
Don't forget to set the shortcut to run Minimized else you will confuse them.
I'll give it another week before I let you know if I now have a group of Happy Monkeys or if they start throwing excrement at me...
As always, let me know if you have any questions, comments, suggestions or the like.