如何确定账户类型? [英] How to Determine Account Type?

查看:140
本文介绍了如何确定账户类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的脚本中,我需要知道一个帐户是Mail-UserMail-Contact还是许可的用户帐户.

In my script I need to know whether an account is a Mail-User, Mail-Contact or licensed user account.

目前,我必须事先知道这一点并将其自己提供给脚本.

Presently I have to know this before-hand and supply it to the script myself.

有没有比这更好的方法了?这仅在许可用户和邮件联系人或邮件用户之间进行计算.

Is there a better way than this? This only figures between a licensed user and a Mail-Contact-or-Mail-User.

#test for existing account
function GetAccountType($whatusername){

    $isType = [bool](get-mailbox -identity $whatusername -ErrorAction SilentlyContinue)
    if($isType){
        $thisType = "Licensed"
    }else{
        $isType = [bool](get-mailuser -identity $whatusername -ErrorAction SilentlyContinue)
        if($isType){
            $thisType = "Mail-Contact"
        }
    }

    return $thisType
}

推荐答案

RecipientTypeDetails 指定返回的收件人的类型.

The RecipientTypeDetails specifies the type of recipients returned.

您可以使用获取收件人从以下值中进行选择:

You can select from the following values with Get-Recipient:

  1. ArbitrationMailbox
  2. ConferenceRoomMailbox
  3. 联系
  4. DiscoveryMailbox
  5. DynamicDistributionGroup
  6. EquipmentMailbox
  7. 外部管理的联系人
  8. ExternalManagedDistributionGroup
  9. LegacyMailbox
  10. LinkedMailbox
  11. MailboxPlan
  12. MailContact
  13. MailForestContact
  14. MailNonUniversalGroup
  15. MailUniversalDistributionGroup
  16. MailUniversalSecurityGroup
  17. MailUser
  18. PublicFolder
  19. 角色组
  20. RoomList
  21. RoomMailbox
  22. SharedMailbox
  23. SystemAttendantMailbox
  24. SystemMailbox
  25. 用户
  26. UserMailbox
  1. ArbitrationMailbox
  2. ConferenceRoomMailbox
  3. Contact
  4. DiscoveryMailbox
  5. DynamicDistributionGroup
  6. EquipmentMailbox
  7. ExternalManagedContact
  8. ExternalManagedDistributionGroup
  9. LegacyMailbox
  10. LinkedMailbox
  11. MailboxPlan
  12. MailContact
  13. MailForestContact
  14. MailNonUniversalGroup
  15. MailUniversalDistributionGroup
  16. MailUniversalSecurityGroup
  17. MailUser
  18. PublicFolder
  19. RoleGroup
  20. RoomList
  21. RoomMailbox
  22. SharedMailbox
  23. SystemAttendantMailbox
  24. SystemMailbox
  25. User
  26. UserMailbox

根据您的情况,我了解到您需要 UserMailbox User MailUser MailContact

What I am understanding from your case is that you need UserMailbox, User , MailUser , MailContact

我现在没有交流设置.但是您可以用这些值来抵消. 它属于 Microsoft.Exchange.Data.Directory.Recipient.RecipientTypeDetails []

I don't have an exchange setup right now. BUt you can set off with these value. It falls under Microsoft.Exchange.Data.Directory.Recipient.RecipientTypeDetails[]

这篇关于如何确定账户类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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