techdrive
asked on
powershell checking multiple instances
I have a small issue. I am trying to figure out the best way to be able to tell all accounts with more than one smtp address and x400 addresses. I am using quest and notice the field s proxyaddresses. Any suggestions to be able to pull out all addresses with more than one smtp
proxyaddresses {smtp:user@again.com, smtp:john.doe@again.com}
or smtp:oneuseraddress@again. com, x400:c=us;a=;p=microsoft ; o=%; s=oneuseraddress@again.com , x400c=us;a:anotheraddress. com}
proxyaddresses {smtp:user@again.com, smtp:john.doe@again.com}
or smtp:oneuseraddress@again.
So you want to return the users which have more than one value in proxyAddresses, and ignore all the others?
You can use ...proxyadresses.Count -gt 1 as condition.
ASKER
Footech yes I would like to only return the users who have more than one proxyaddresses and ignore the others. This is correct.
where {$_.proxyaddress.count -gt 1} <----is this correct Qlemo?
where {$_.proxyaddress.count -gt 1} <----is this correct Qlemo?
where {$_.proxyaddresses.count -gt 1}
ASKER
I knew that was too easy. I am trying to get only if the SMTP has more than one. I am finding that all users have x400 and sips. I do not want to pull that info
smtp:oneuseraddress@again. com, x400:c=us;a=;p=microsoft ; o=%; s=oneuseraddress@again.com , x400c=us;a:anotheraddress. com}
smtp:oneuseraddress@again.
Well, then just check for count greater 2!
ASKER
well I would like to omit the others and just have smtp.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just noticed my number for the count was wrong (change the 3 to a 1 to fit your needs). Blame it on my testing and pasting.
ASKER
thanks