<report xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
        xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
        xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
        xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
        xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        oid="bbbbcc02-0000-0000-0000-000000000002">
    <name>Collection Report: AD Orphaned Accounts</name>
    <description>
        AD account shadows that exist in the MidPoint repository but are not
        linked to any MidPoint user. These are orphan accounts — either never
        correlated, manually created directly on AD, or left behind after a
        user was deleted without deprovisioning.
    </description>

    <objectCollection>
        <collection>
            <filter>
                <q:text>
                    resourceRef matches (oid = "572fc2e9-dad8-4b52-955e-50c8d1ff082c")
                    and kind = "ACCOUNT"
                    and intent = "Account"
                    and synchronizationSituation != "LINKED"
                </q:text>
            </filter>
			<baseCollectionRef>
                <collectionRef oid="72b1f98e-f587-4b9f-b92b-72e251dbb244" relation="org:default" type="c:ObjectCollectionType">
                </collectionRef>
            </baseCollectionRef>
        </collection>
        <view>
            <identifier>AD orphan accounts</identifier>
            <type>ShadowType</type>
            <column>
                <name>firstNameColumn</name>
                <path>attributes/firstname</path>
                <display>
                    <label>First name</label>
                </display>
                <previousColumn>nameColumn</previousColumn>
            </column>
            <column>
                <name>lastNameColumn</name>
                <path>attributes/lastname</path>
                <display>
                    <label>Last name</label>
                </display>
                <previousColumn>firstNameColumn</previousColumn>
            </column>

        </view>

        <useOnlyReportView>true</useOnlyReportView>

    </objectCollection>

    <fileFormat>
        <type>csv</type>
    </fileFormat>

</report>