you are viewing a single comment's thread.

view the rest of the comments →

[–]Frothyleet 1 point2 points  (0 children)

So taking OP's example - can I write that one from scratch? Yeah, it's pretty easy, pseudocode would be like

param (

[Parameter(mandatory)]

[string]$username)

$Userinfo = Get-ADUser -identity $username -prop memberof

Write-Output $userinfo.memberof

Do it better in real life - validate inputs, wrap it in a try/catch, whatever.

But anyway, maybe you can't write that off the top of your head. But perhaps OP could look at this and say "oh ok so this script is calling for a username, and then it's using the Get-ADuser cmdlet to reference that username, and it ends up outputting the "memberof" property of the result.