如何获取邮件联系人所属的所有组? [英] How to get all groups that a mail-contact belongs to?

查看:135
本文介绍了如何获取邮件联系人所属的所有组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码将查找特定电子邮件帐户或mail-user帐户所属的所有组.

This code will find all groups to which a particular email account or mail-user account belongs.

get-group | where-object -FilterScript {$_.Members -contains $user}

但是,在O365中,您可以拥有mail-contacts而不是用户-他们仅用于邮件列表;他们没有windowsliveid,因此不会在$_.Members中找到.

However, in O365 you can have mail-contacts who are not users - they are used just for mailing lists; they don't have a windowsliveid, so they won't be found in $_.Members.

如何找到特定mail-contact所属的所有组?

How can I find all groups that a particular mail-contact belongs to?

推荐答案

好,

显然,如果将get-contact值捕获到变量中,则get-group$_.members可以搜索那个.我在此处输入名称的字符串值,但始终变成空.就像魅力一样.

Apparently, if you catch the get-contact value into a variable, then get-group's $_.members can search for that. I was putting the string value for the name there, but that always turned up empty. This works like a charm.

这篇关于如何获取邮件联系人所属的所有组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆