This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Deprovisioned user report - performance

 Hi All

I'm trying to construct a PowerShell report which will give me a list of Users created and deprovisioned in the previous calendar month.

So far, I have it working, but the search for deprovisioned users takes forever (An hour or two - I have 100,000 user objects in AD) using this command:

get-qaduser -SearchAttributes @{edsvaDeprovisionStatus='1'} -SizeLimit 0 -DontUseDefaultIncludedProperties -IncludedProperties userprincipalname,mail,edsvadeprovisionreportxml,edsvaDeprovisionStatus

 

After I get the list of users, I then have to deconstruct the XML report in the edsvadeprovisionreportxml attribute of each user to find the date the Deprovision was requested like this:

[xml]$xml = $_.edsvadeprovisionreportxml
[datetime]$DeprovDate = $xml.report.table.row.sections.section[1].list.item | where {$_.name -eq 'Requested:'} | %{$_.t.date}

 

2 questions:

1 - Can this query be improved for faster performance?  I'm wondering if it's possible to have ARS index the edsvaDeprovisionStatus attribute for better search performance. Maybe different search criteria or syntax?

 

2. Is it possible to search for the deprovision date "natively", or am I stuck with the XML report deconstruction?

 

Thanks

Joe

Parents
  • The other thing I was going to suggest is to get ActiveRoles to do the work for you in building your list of deprovisioned users. You could create a Managed Unit that has a membership rule / query that searches on edsvaDeprovisionStatus='1'. Then you can use the Managed Unit's distinguished name as your 'SearchRoot' parameter for your Get-QADUser if you still want to use your current approach.

Reply
  • The other thing I was going to suggest is to get ActiveRoles to do the work for you in building your list of deprovisioned users. You could create a Managed Unit that has a membership rule / query that searches on edsvaDeprovisionStatus='1'. Then you can use the Managed Unit's distinguished name as your 'SearchRoot' parameter for your Get-QADUser if you still want to use your current approach.

Children
No Data