but I am loving it. I am stuck at the end of my little script and am
having problems comparing/parsing through two csv files and exporting
the difference in the same format. Ok, so below you will find so far what kind of
compare string has been put together so far with the help of Dmitri.
Now somehow wrong spacing was freaking out the box and causing the
script to use up 50% cpu and never stop, that has been fixed. But, the
script still doesn't perform the functions needed.
Code: Select all
$Master = import-csv c:scriptsmaster.csv$New = import-csv c:scriptsnew.csvCompare-Object $Master $New|Where {$._SideIndicator -eq '=>'}|ForEach-Object {$_.InputObject}|Export-Csv c:scriptsfinalnew.csv[CODE]Basically,
I want it to read each line in the master csv (grabbing all the
information from each line) and parse through every line on the new.csv
file to make sure none of that information is already on the master.
e.g : If line 1 is on master and also on new, do not include it on the
finalnew.csv or viceversa; whatever can make the script better would be
cool. I basically will be using this as a master list for approved
users and new as the new users and make sure that the difference is the
output.I will also post below the code that I am using to
export the information from AD and to create the new.csv file I
reference above.Any help/suggestions are welcomed
and appreciated![CODE]Get-QADUser -enabled -sizelimit 0 |Select-Object
SamAccountName,@{n="LastLogonTimeStamp";e={$_.LastLogonTimeStamp.value}},WhenCreated,PasswordNeverExpires,AccountExpires,Description|Sort-Object LastLogonTimeStamp |Export-Csv c:scriptsnew.csv[CODE]