I am trying to update a SQL table with some ad information. I do not want to drop the table every time that i want to update the table. I want some fails in place incase something goes wrong.
What i want to do is to export all the users from ad with a list of ad properties. That i have down with "Get-ADUser -Filter * -Properties * | Sort-Object cn" with what properties that i want to export.
So i want to have a MS SQL table with that information in it. I also what to be able to run an update every 15 minutes to update if for say the user is disabled or the account has a expiration date set. Or removed. I then need to know if the account was deleted to remove that entry from the sql table.
I was trying to do a compare-object with the two arrays and not getting to fair. Does someone have something for this? Has anyone tried