Hello Mark,
I hope you are doing well.
I have reviewed your requirement to export information for the External Source–related GroupID pseudo attributes, such as ObjectTypes, DataSourceUserName, DataSourcePassword, DataSourceName, TableOrView, and DataSourceType.
In GroupID v11, the architecture has changed. Since data source connections are now created in the Admin Center, attributes such as DataSourcePassword, DataSourceName, and DataSourceUserName are no longer part of the object attributes in Elasticsearch. Instead, these attributes are now referenced in the SmartGroups by using the attribute imsgexternaldataproviderid.
That said, the remaining attributes related to External Sources are still present in Elasticsearch. I have updated and adjusted your previously shared query to account for the attributes that have changed.
Here is the updated script:
$imsgAttributes = @(
'targetaddress', 'msexchrecipienttypedetails', 'reporttooriginator', 'unauthorig', 'extensionattribute12', 'extensionattribute5', 'hidedlmembership', 'proxyaddresses', 'protocolsettings', 'objecttype', 'location', 'info', 'imsgstartpath', 'extensionattribute10', 'samaccountname', 'grouptype', 'imsggroupenabled', 'ismailbox', 'extensionattribute15', 'oofreplytooriginator', 'usncreated', 'whencreated', 'computedmanagedtype', 'extensionattribute1', 'ComputedGroupType', 'cn', 'msexchhidefromaddresslists', 'msexchrequireauthtosendto', 'distinguishedname', 'submissioncontlength', 'DistinguishedName', 'dlmemrejectperms', 'modifytimestamp', 'extensionattribute2', 'XGroupSecurity', 'authorigbl', 'imsgserverfilter', 'extensionattribute8', 'mdboverhardquotalimit', 'msexchhomeservername', 'delivcontlength', 'extensionattribute14', 'company', 'extensionattribute7', 'displayname', 'department', 'imsgexternaldataproviderid', 'imsgstorefilter', 'usnchanged', 'managedobjects', 'displaynameprintable', 'imsgcriteria', 'imsgmembersupdatedstatus', 'objectclass', 'Domain', 'managercanupdatemembershiplist', 'extensionattribute3', 'primarygrouptoken', 'authorig', 'lastknownparent', 'imsgexcludes', 'isrecycled', 'managedby', 'domain', 'imsggroupidconnectionstring', 'reporttoowner', 'extensionattribute6', 'forwardingaddress', 'extensionattribute11', 'imsgkeymapdb', 'xwhenchanged', 'member', 'isdeleted', 'msexchremoterecipienttype', 'mdbstoragequota', 'canonicalname', 'imsgmembersupdatedfrom', 'computedgrouptype', 'memberof', 'imsgincludedisabledusers', 'xgroupsecurity', 'mail', 'description', 'mdbusedefaults', 'xgroupexpirationpolicy', 'admindescription', 'objectcategory', 'imsgincludes', 'extensionattribute13', 'whenchanged', 'extensionattribute9', 'mailnickname', 'msexchcomanagedbylink', 'ComputedGroupScope', 'mdboverquotalimit', 'imsggroupidversion', 'ca_ismailenabledgroup', 'imgisexpired', 'imgisdeleted', 'createtimestamp', 'iscriticalsystemobject', 'imsgsearchservername', 'ismailenabled', 'name', 'msexchreciplimit', 'xgroupexpirationdate', 'wwwhomepage', 'imsgobjecttypes', 'objectsid', 'imsgkeymapprovider', 'msexchrecipientdisplaytype', 'imsggroupidstatement', 'legacyexchangedn', 'computedgroupscope', 'dlmemsubmitperms', 'msexchexpansionservername', 'showinaddressbook', 'imsgcreatedinversion', 'imsgscript', 'extensionattribute4', 'samaccounttype', 'imsgmanagedgrouptype', 'imsgmembersupdatedon', 'container', 'objectguid', 'owner', 'xadditionalowner'
)
$smartGroups = @()
foreach ($group in Get-Group -SmartFilter "(IMSGManagedGroupType=2)" -MaxItemsToDisplay 0) {
$smartGroup = Get-Object -Identity $group.SAMAccountName -AttributesToLoad $imsgAttributes
$includes = if ($smartGroup.imsgincludes) {
$smartGroup.imsgincludes | ForEach-Object {
try { (Get-User -Identity $_).sAMAccountName } catch { "$_ (unresolved)" }
} -join ","
}
$excludes = if ($smartGroup.imsgexcludes) {
$smartGroup.imsgexcludes | ForEach-Object {
try { (Get-User -Identity $_).sAMAccountName } catch { "$_ (unresolved)" }
} -join ","
}
$smartGroup | Add-Member -MemberType NoteProperty -Name "Criteria" -Value $criteria
$smartGroup | Add-Member -MemberType NoteProperty -Name "Includes" -Value $includes
$smartGroup | Add-Member -MemberType NoteProperty -Name "Excludes" -Value $excludes
$smartGroups += $smartGroup
}
$smartGroups | Export-Csv -Path "C:\SmartGroup_Export.csv" -NoTypeInformation
Please let us know if this works for you or if you have any further questions or concerns.
Thanks,
Turab