0

My goal is: I have to get information straight from AD server about all users in all active directory non empty groups(mail, account name, full name). i Have to put it into my Active Directory Database prepared for it. I want to have a SSIS package to run it nightly and refresh my data about all groups and users.

What i have tried so far:

1) First of all i have tried open query like this: http://www.ryanjadams.com/2016/03/query-active-directory-sql-server/#axzz4FanSmp3J

I have failed because of so much limitation of it. I could only fetch 901 rows and it doesn't work as i want it to work.

Maybe this is good solution but i don't now everything how to obtain my goal through linked server and open query?

2) My second step was power shell: I got my power shell script like this:

Get-ADGroup -filter "Groupcategory -eq 'Security' -AND Member -like '*'" |
foreach { 
 Write-Host "Exporting $($_.name)" -ForegroundColor Cyan
 $name = $_.name -replace " ","-"
 $file = Join-Path -path "C:\MyPath\GroupFiles" -ChildPath "$name.csv"
 Get-ADGroupMember -Identity $_.distinguishedname -Recursive |  
 Get-ADObject -Properties SamAccountname,Title,Department |
 Select Name,SamAccountName,Title,Department,DistinguishedName,ObjectClass |
 Export-Csv -Path $file -NoTypeInformation
}

enter code here

Code above is creating for me csv with the name of Group and all users in it but unfortunately it creates me only 256 groups and its stops stops working.

3) I know that third step should be a C# script in SSIS but i am totally new in C# and maybe i will do it in the future but i have limited time to achieve my goal and i don't want to waste my time for learning C# from the beginning.

So my question is should i consider any fourth approach for my problem? If not what is the best solution to have my work done: 1,2,3?

Maybe someone faced the same problem in the past and got a solution?

Maybe someone could improve any of: 1 or 2 to help me with solving it?

I would appreciate your help, BR

odrzyja0
  • 103
  • 1
  • 9
  • We used Microsoft OLE DB Provider for Microsoft Active Directory Service on SSIS and worked pretty well. https://msdn.microsoft.com/es-es/library/ms681571(v=vs.85).aspx – vercelli Jul 27 '16 at 08:47
  • 1
    Thanks for the input i will definitely try it right now :) – odrzyja0 Jul 27 '16 at 08:52

0 Answers0