How to Get a List of Users from AD to Compare against Users in Lawson

, ,

This process is going to assume you already know how to build a Lawson CSV report of users to compare against. LSA Report Maintenance has these report options available for this.

 

  1. Login into your windows machine and open Powershell as an Administrator.
  2. Type in this command: Get-ADUser -Filter * -SearchBase “dc=domain,dc=local” | select Name,SID | Export-CSV
    1. dc=domain,dc=local will need to be updated to match your organizations.
    2. select Name,SID will extract the users Name in AD (typically First and Last Name) and their Security ID.
    3. Since we are doing this to compare against Lawson users (assuming you’re using SSOP), you want to also include the sAMAccountName, this is login name the users use to login into their windows machine.
    4. Export-CSV Requires a path after it including filename,
      • example: Export-CSV C:\ExportDirectory\ADUserList.csv
  3. For example, if you only wanted the Name and sAMAccountName use the command below:
    1. Get-ADUser -Filter * -SearchBase “dc=Yourdomain,dc=Yourlocal” | select Name,sAMAccountName | Export-CSV C:\ExportDirectory\ADUserList.csv
      • NOTE: If you type dc=domain,dc=local incorrectly, Powershell will list the allowed partition(s), see screenshot below.
  4. If you only want Name and SID use the command below:
    1. Get-ADUser -Filter * -SearchBase “dc=Yourdomain,dc=Yourlocal” | select Name,SID | Export-CSV C:\ExportDirectory\ADUserList.csv

You should now be able to acquire the CSV file in your C:\ExportDirectory\ that you outputted to.

Good luck!