Author Posts

April 28, 2017 at 1:23 pm

Hi

I have a newbie problem with Exchange Management Shell
I am trying script a way to get a list of members from a Address List. I first assign the address list to a variable.

$al = Get-AddressList -Identity "all rooms"

I can get the LDAP path by doing this

$AL.DistringuishedName

My problem is putting singel quotes around the LDAP path, so i can do somthing like this

Get-Recipient -filter {addresslistmembership -eq '$AL.DistringuishedName'}

April 28, 2017 at 1:27 pm

you can use subexpressions for this

"'$($AL.DistringuishedName)'"

April 28, 2017 at 1:39 pm

Thanks

That does put single quotes around the LDAP path, but

Get-Recipient -filter {addresslistmembership -eq "'$($al.DistinguishedName)'"}

still don't give any output

April 28, 2017 at 2:00 pm

oooops ... that's what we call "Flüchtigkeitsfehler" 😉
Try it that way:

"$($AL.DistringuishedName)"

(without the single quotes)
Edit: I think it should work even without the quotes

April 28, 2017 at 3:17 pm

Hey hey ... I am a nice guy! 😛