有没有办法通过 Exchange PowerShell 查询谁是 activesync/bb 用户?

发布于 2024-07-10 06:26:11 字数 71 浏览 5 评论 0原文

有没有办法使用 powershell Exchange 插件查询 Exchange 2007 来区分谁是活动同步用户或黑莓用户?

Is there a way to query against exchange 2007 to distinguish who is either an active sync or blackberry user using powershell exchange addin?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

后eg是否自 2024-07-17 06:26:12

BBES 通常使用有权访问所有邮箱的服务帐户来执行其操作。 您需要查看 BBES 服务器本身以找出哪些用户处于活动状态,而不是 AD 或 Exchange。 因为 BBES 由数据库支持,所以只需深入研究 dbo.UserStats 表即可查看其中的内容。

BBES typically uses a service account that has access to ALL mailboxes in order to do it's thing. you will want to look at the BBES server itself to find out which users are active, not AD or Exchange. Because BBES is backed by a database, just dig into the dbo.UserStats table to see what's there.

阳光的暖冬 2024-07-17 06:26:12

试试这个。

获取 CASMailbox -结果大小无限制 | Where-Object {$_.ActiveSyncEnabled -eq "True" } | 选择对象 SamAccountName,ActiveSyncEnabled

Try this one.

Get-CASMailbox -resultsize unlimited | Where-Object {$_.ActiveSyncEnabled -eq "True" } | Select-Object SamAccountName,ActiveSyncEnabled

眼睛会笑 2024-07-17 06:26:12

您可以查询以查看哪些邮箱启用了必要的权限 - 就像您可以查看哪些邮箱启用了 OWA 一样。 这实际上并不能告诉您谁正在使用该功能,而只是告诉您谁可以使用该功能。

You could query to see which mailboxes have the necessary permission enabled - just as you could see which mailboxes are OWA-enabled. That won't actually tell you who is USING the capability, merely who COULD.

当爱已成负担 2024-07-17 06:26:12

我发现 powershell 中有一个 cmdlet 可以描述 activesync 是否在线。

如果你运行> 获取 cas 邮箱 | get-member

我注意到列表中有一个 ActiveSyncEnabled 属性

I figured out there is a cmdlet in powershell which does describe if activesync is online or not.

If you run > get-casmailbox | get-member

I noticed there is a ActiveSyncEnabled property in list

水晶透心 2024-07-17 06:26:12

我确实从这个网站找到了这个vbscript。http://blogs.technet.com/mjimenez/archive/2007/07/30/how- do-i-programmatically-disable-enable-microsoft-exchange-active-sync-for-all-of-my-mobile-users.aspx

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
'' DISABLEEAS.VBS
''
'' Disables Exchange Server 2003 Active Sync for the specified OU in the default domain
''
'' usage: cscript disableeas
''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Below are the values for the msExchOmaAdminWirelessEnable Exchange attribute that can be modified.
' 5 = disable EAS and keep OMA enabled.(default)
' 7 = disable all mobile features.
' 0 = enable all mobile features. (not recommended)


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Create log file instance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("c:\disableeas.log", 2, True, 0)
If Err.Number <> 0 Then
  ' Attempt to create a log file failed. 
  On Error GoTo 0
  objLogFile.WriteLine "ERROR: Failed to create a log file.Program execution halted."
  WScript.Echo "ERROR: Failed to create a log file. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' Successfully Created Disableeas.log file. Restore normal error handling.
  On Error GoTo 0
  objLogFile.WriteLine "disableeas.log created successfully"
End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Determine DNS domain name
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set objRootDSE = GetObject("LDAP://rootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBaseOU = "" 'SPECIFY AND ORGANIZATIONAL UNIT NAME HERE. FOR EXAMPLE 'OU=Production
If Err.Number <> 0 Then
  ' Attempt to bind to Active Directory Failed.
  On Error GoTo 0
  objLogFile.WriteLine "ERROR: Binding to Active Directory Failed. Program execution halted."
  WScript.Echo "ERROR: Binding to Active Directory Failed. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' Active Directory bind successful
  On Error GoTo 0
  objLogFile.WriteLine "Binding to Active Directory successful"
End If 


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Setup ADO for Active Directory
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
If Err.Number <> 0 Then
  ' Attempt to search Active Directory Failed.
  On Error GoTo 0
  objLogFile.WriteLine "ERROR: ADO Setup for Active Directory Failed. Program execution halted."
  WScript.Echo "ERROR: ADO Setup for Active Directory Failed. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' ADO Active Directory setup successful
  On Error GoTo 0
  objLogFile.WriteLine "Active Directory setup successful"
End If 

' Test whether an OU is specified.
If strBaseOU <> "" Then
 strBase="<LDAP://" & strBaseOU & "," & strDNSDomain & ">"
Else strBase="<LDAP://" & strDNSDomain & ">"
End If
'strBase="<LDAP://" & strDNSDomain & ">"
wscript.echo strBase


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Search for users with defined filters
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

strFilter = "(&(objectCategory=person)(objectClass=user)(!msExchOmaAdminWirelessEnable=5)(mail=*)(userAccountControl=66048))"
strAttributes = "distinguishedName"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
If Err.Number <> 0 Then
  ' Attempt to search within defined parameters failed.
  On Error GoTo 0
  objLogFile.WriteLine "Attempt to search within defined parameters failed. Program execution halted."
  WScript.Echo "ERROR: Attempt to search within defined parameters failed. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' Active Directory bind successful
  On Error GoTo 0
  objLogFile.WriteLine "Search within defined parameters was successful"
End If 


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Enuerate all users
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Do Until objRecordSet.EOF
  strDN = objRecordSet.Fields("distinguishedName")
  Set objUser = GetObject("LDAP://" & strDN)
   On Error Resume Next
   objUser.Get("msExchOmaAdminWirelessEnable")
   On Error GoTo 0
    objUser.Put "msExchOmaAdminWirelessEnable", "5"
    objUser.SetInfo
       If Err.Number <> 0 Then
        On Error GoTo 0
 objLogFile.Writeline "ERROR: Unfortunately, the required mobile attribute generated an error can could not be set. Program execution halted."
        WScript.Echo "ERROR: Unfortunately, the required mobile attribute generated an error can could not be set. Program execution halted."
        Wscript.Quit
        objLogFile.Close
        Set objFSO = Nothing
       Else
        On Error GoTo 0
        objLogFile.Writeline "User mobile properties successfully modified: " & objUser.Name
     Wscript.Echo "User mobile properties successfully modified: " & objUser.Name
       End If
 '  End If
  objRecordSet.MoveNext
Loop

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Clean up
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

objLogFile.WriteLine "End Program"
Wscript.Echo "End Program"

objLogFile.Close

我希望有一种方法可以做到这一点由用户而不是 ou..

I did find this vbscript from this website.http://blogs.technet.com/mjimenez/archive/2007/07/30/how-do-i-programmatically-disable-enable-microsoft-exchange-active-sync-for-all-of-my-mobile-users.aspx

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
'' DISABLEEAS.VBS
''
'' Disables Exchange Server 2003 Active Sync for the specified OU in the default domain
''
'' usage: cscript disableeas
''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Below are the values for the msExchOmaAdminWirelessEnable Exchange attribute that can be modified.
' 5 = disable EAS and keep OMA enabled.(default)
' 7 = disable all mobile features.
' 0 = enable all mobile features. (not recommended)


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Create log file instance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("c:\disableeas.log", 2, True, 0)
If Err.Number <> 0 Then
  ' Attempt to create a log file failed. 
  On Error GoTo 0
  objLogFile.WriteLine "ERROR: Failed to create a log file.Program execution halted."
  WScript.Echo "ERROR: Failed to create a log file. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' Successfully Created Disableeas.log file. Restore normal error handling.
  On Error GoTo 0
  objLogFile.WriteLine "disableeas.log created successfully"
End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Determine DNS domain name
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set objRootDSE = GetObject("LDAP://rootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBaseOU = "" 'SPECIFY AND ORGANIZATIONAL UNIT NAME HERE. FOR EXAMPLE 'OU=Production
If Err.Number <> 0 Then
  ' Attempt to bind to Active Directory Failed.
  On Error GoTo 0
  objLogFile.WriteLine "ERROR: Binding to Active Directory Failed. Program execution halted."
  WScript.Echo "ERROR: Binding to Active Directory Failed. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' Active Directory bind successful
  On Error GoTo 0
  objLogFile.WriteLine "Binding to Active Directory successful"
End If 


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Setup ADO for Active Directory
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
If Err.Number <> 0 Then
  ' Attempt to search Active Directory Failed.
  On Error GoTo 0
  objLogFile.WriteLine "ERROR: ADO Setup for Active Directory Failed. Program execution halted."
  WScript.Echo "ERROR: ADO Setup for Active Directory Failed. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' ADO Active Directory setup successful
  On Error GoTo 0
  objLogFile.WriteLine "Active Directory setup successful"
End If 

' Test whether an OU is specified.
If strBaseOU <> "" Then
 strBase="<LDAP://" & strBaseOU & "," & strDNSDomain & ">"
Else strBase="<LDAP://" & strDNSDomain & ">"
End If
'strBase="<LDAP://" & strDNSDomain & ">"
wscript.echo strBase


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Search for users with defined filters
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

strFilter = "(&(objectCategory=person)(objectClass=user)(!msExchOmaAdminWirelessEnable=5)(mail=*)(userAccountControl=66048))"
strAttributes = "distinguishedName"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
If Err.Number <> 0 Then
  ' Attempt to search within defined parameters failed.
  On Error GoTo 0
  objLogFile.WriteLine "Attempt to search within defined parameters failed. Program execution halted."
  WScript.Echo "ERROR: Attempt to search within defined parameters failed. Program execution halted."
  WScript.Quit
  objLogFile.Close
  Set objFSO = Nothing
Else
  ' Active Directory bind successful
  On Error GoTo 0
  objLogFile.WriteLine "Search within defined parameters was successful"
End If 


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Enuerate all users
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Do Until objRecordSet.EOF
  strDN = objRecordSet.Fields("distinguishedName")
  Set objUser = GetObject("LDAP://" & strDN)
   On Error Resume Next
   objUser.Get("msExchOmaAdminWirelessEnable")
   On Error GoTo 0
    objUser.Put "msExchOmaAdminWirelessEnable", "5"
    objUser.SetInfo
       If Err.Number <> 0 Then
        On Error GoTo 0
 objLogFile.Writeline "ERROR: Unfortunately, the required mobile attribute generated an error can could not be set. Program execution halted."
        WScript.Echo "ERROR: Unfortunately, the required mobile attribute generated an error can could not be set. Program execution halted."
        Wscript.Quit
        objLogFile.Close
        Set objFSO = Nothing
       Else
        On Error GoTo 0
        objLogFile.Writeline "User mobile properties successfully modified: " & objUser.Name
     Wscript.Echo "User mobile properties successfully modified: " & objUser.Name
       End If
 '  End If
  objRecordSet.MoveNext
Loop

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Clean up
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

objLogFile.WriteLine "End Program"
Wscript.Echo "End Program"

objLogFile.Close

I'm hoping there is a way to do this by user instead of ou..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文