CuriousMAUser
asked on
Can PowerShell compare two CSV files? Or should I import the CSV file to multiple worksheets in a single workbook?
Is there a way to import weekly CSV files into an Excel workbook to compare or is there a PowerShell script to compare two CSV files?
Option 1: Within Excel I want my multiple CSV files to be imported into multiple worksheets within a single workbook only and develop a macro to compare two separate sheets with separate weekly AD group membership information and determine if there is a difference. For example, export from AD, with PowerShell, the group membership and determine weekly if there were additions or deletions from the membership list from the prior week.
Option 2: Develop a PowerShell script to compare two CSV files from Week1 & Week2?
Get-ADGroupMember "Domain Admins" | Export-CSV C:\PowerShellOutput\Domain AdminsGrou pMembershi pWeek1.csv
Get-ADGroupMember "Schema Admins" | Export-CSV C:\PowerShellOutput\Schema AdminsGrou pMembershi pWeek1.csv
Get-ADGroupMember "Enterprise Admins" | Export-CSV C:\PowerShellOutput\Enterp riseAdmins GroupMembe rshipWeek1 .csv
Get-ADGroupMember "Administrators" | Export-CSV C:\PowerShellOutput\Admini stratorsGr oupMembers hipWeek1.c sv
Get-ADGroupMember "Domain Admins" | Export-CSV C:\PowerShellOutput\Domain AdminsGrou pMembershi pWeek2.csv
Get-ADGroupMember "Schema Admins" | Export-CSV C:\PowerShellOutput\Schema AdminsGrou pMembershi pWeek2.csv
Get-ADGroupMember "Enterprise Admins" | Export-CSV C:\PowerShellOutput\Enterp riseAdmins GroupMembe rshipWeek2 .csv
Get-ADGroupMember "Administrators" | Export-CSV C:\PowerShellOutput\Admini stratorsGr oupMembers hipWeek2.c sv
Option 1: Within Excel I want my multiple CSV files to be imported into multiple worksheets within a single workbook only and develop a macro to compare two separate sheets with separate weekly AD group membership information and determine if there is a difference. For example, export from AD, with PowerShell, the group membership and determine weekly if there were additions or deletions from the membership list from the prior week.
Option 2: Develop a PowerShell script to compare two CSV files from Week1 & Week2?
Get-ADGroupMember "Domain Admins" | Export-CSV C:\PowerShellOutput\Domain
Get-ADGroupMember "Schema Admins" | Export-CSV C:\PowerShellOutput\Schema
Get-ADGroupMember "Enterprise Admins" | Export-CSV C:\PowerShellOutput\Enterp
Get-ADGroupMember "Administrators" | Export-CSV C:\PowerShellOutput\Admini
Get-ADGroupMember "Domain Admins" | Export-CSV C:\PowerShellOutput\Domain
Get-ADGroupMember "Schema Admins" | Export-CSV C:\PowerShellOutput\Schema
Get-ADGroupMember "Enterprise Admins" | Export-CSV C:\PowerShellOutput\Enterp
Get-ADGroupMember "Administrators" | Export-CSV C:\PowerShellOutput\Admini
I can give you an option but without Powershell. what about using Excel Add-Ins and VBA? instead of Powershell?
ASKER
Sure. What are your thoughts ProfessorJimJam?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.