Hmmmm I’m bored of myself: today’s script is another mutation of my enumerate nested group script.
Added are the owa (outlook web access) settings of all users. When a user has owa the last value of each line is “yes”. The owa settings for win/exchange 2003 are found through the user attribute “protocolSettings”.
Default setting for owa is “on”. The array protocolsettings has no specific owa entry at that moment.
When owa is explicitely denied the setting is created, when owa is enabled again this setting is altered.
Follow the next steps to run the script (no admin rights needed):
- copy and paste the script in your favorite text editor
- change the distinguished name of the nested group to your group distinguished name
- save the script (for example c:\temp\enumeratenestedgroupowa.vbs)
- open a command prompt
- go to “c:\temp”
- give “cscript enumeratenestedgroupowa.vbs” (without quotes) and enter
The script:
' Name : enumeratenestedgroupowa.vbs
' Description : script to enumerate the owa (outlook web access) settings of all users of a nested group
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 15-04-2010
' Level: intermediate
strTargetGroupDN = "LDAP://CN=testgroup,OU=Groups,DC=test,DC=org"
EnumNestedgroup strTargetGroupDN
Sub EnumNestedgroup(strGroupDN)
Set objGroup = GetObject(strGroupDN)
For Each objMember in objGroup.Members
If (LCase(objMember.Class) = "group") Then
EnumNestedgroup objMember.AdsPath
Else
strOwa = "Yes"
If TypeName(objMember.[protocolSettings]) = "Variant()" Then
arrProtocolsettings = objMember.[protocolSettings]
For Each Protocol in arrProtocolsettings
If Protocol = "HTTP§0§1§§§§§§" Then
strOWA = "No"
End If
Next
End If
Wscript.Echo objMember.DisplayName & " ; " & objMember.Mail & " ; " & strOWA
End If
Next
Set objGroup = Nothing
End Sub
When you have problems/questions please post a reply or give a ‘star’ rating.
Happy scripting.
Best regards,
Dirk Adamsky – Deludi BV
VN:F [1.9.4_1102]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.4_1102]
Outlook web access is incorporated in Active Directory through the user attribute “protocolSettings”.
Default setting is for owa is ‘enabled’. The attribute ‘protocolSettings’ has no specific entry for owa at this stage. Only when owa is explicitly denied for a specific user an entry is added, the value of this entry is:
HTTP§0§1§§§§§§. When owa is enabled again for this user the value changes to HTTP§0§0§§§§§§.
This script is tested for outlook/exchange2003.
Follow the next steps to run the script (no admin rights needed):
* open your favorite text editor
* copy and paste the script into the editor
* save the script (for example c:\temp\owausers.vbs)
* open a command prompt
* go to “c:\temp”
* give “cscript owausers.vbs” (without quotes) and enter
The script:
' Name : owausers.vbs
' Description : script to enumerate all users with Outlook Web Access (owa)
' Author : dirk adamsky - deludi bv
' Version : 1.00
' Date : 22-03-2010
' Level : intermediate
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
Set objRootDSE = GetObject("LDAP://RootDSE")
strBase = "<LDAP://" & objRootDSE.Get("defaultNamingContext") & ">"
Set objRootDSE = Nothing
strFilter = "(&(objectCategory=person)(objectClass=user)(mail=*)(!(cn=systemmailbox*)))"
strAttributes = "distinguishedname, mail, displayname, protocolSettings"
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
Do Until objRecordSet.EOF
strOwa = "Yes"
If TypeName(objRecordSet.Fields("protocolSettings").value) = "Variant()" Then
arrProtocolsettings = objRecordSet.Fields("protocolSettings").value
For Each Protocol in arrProtocolsettings
If Protocol = "HTTP§0§1§§§§§§" Then
strOWA = "No"
End If
Next
End If
Wscript.Echo objRecordSet.Fields("displayname").Value & " uses outlook web access = " & strOwa
objRecordSet.MoveNext
Loop
objRecordSet.Close
objConnection.Close
Set objRecordSet = Nothing
Set objConnection = Nothing
Set objCommand = Nothing
When you have problems/questions please post a reply, you can also rate the script.
Happy scripting.
Best regards,
Dirk Adamsky – Deludi BV
VN:F [1.9.4_1102]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.4_1102]
Recent Comments