Powershell script modification assistance

Hello,

I have the following script:

Get-AdfineGrainedPasswordPolicy -Filter * | select Name, MinPasswordLength,LockoutDuration,msds-psoappliesto

I am not getting any values returned for msds-psoappliesto. It is a multivalued attribute. It contains a list of group/user DN's

How would I go about retrieving values for this multivalued attribute.

Thanks
Parity123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aikimarkCommented:
you might need to iterate it with a foreach {} construct, building your object/output with each iteration.
0
Parity123Author Commented:
Could you please give me an example. Thanks.
0
aikimarkCommented:
I'm not on an AD system, so I can't test any code.  Are you familiar with foreach {}?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Parity123Author Commented:
I tried this and it does not return anything for psoappliesto

Get-AdfineGrainedPasswordPolicy -Filter * | select Name, MinPasswordLength,LockoutDuration,@{N="Applies To";E={$_.psoappliesto}}
0
aikimarkCommented:
You should click on the Request Attention link.  You need the help of an expert that has access to an AD system.
0
Parity123Author Commented:
The following works:


Get-AdfineGrainedPasswordPolicy -Filter * | select Name, MinPasswordLength,LockoutDuration,@{N="Applies To";E={$_.appliesto -join ";"}}

Now I need to get individual element from "AppliesTo", check if it is a group, and if it is a group check managedby properties.
0
aikimarkCommented:
That is where iteration and filtering would happen
0
DBAduck - Ben MillerPrincipal ConsultantCommented:
Could you try this:

Get-AdfineGrainedPasswordPolicy -Filter * | foreach { foreach($item in $_.appliesto) { do something here with $item } }

Basically you are iterating over the AppliesTo property in each PasswordPolicy.
0
Parity123Author Commented:
The following works

$results = Get-AdfineGrainedPasswordPolicy -Filter *

 foreach($item in $results) { do something here with $item }
0
DBAduck - Ben MillerPrincipal ConsultantCommented:
It is kind of the same thing as I was illustrating.  I was just showing you the way with the Pipeline but getting the results and then iterating them is certainly an option as well.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.