We help IT Professionals succeed at work.
Get Started

Combining two 'lists'

sirbounty asked
Last Modified: 2015-02-26
I'm running a script to gain some info from get-aduser and dumping to a bunch of CSVs.
I then collect each of these CSV files into one var, $ImportedData.
Next, I check the items present, because if there was a hiccup for whatever reason, I drop "ERROR" in the data, rather than the user's info.
So I filter $ImportedData | where {$_.displayname -like 'ERROR'}
I want to take that grouping and give it one more try, 90% of them work on a subsequent attempt, so I suspect launching these threads at once is causing a timeout.

So, I will be looping through the $Errors and running another get-aduser against the IDs.
But I then want to replace what's in $ImportedData with what I get from my second attempt, although not everything.
So if right now $ImportedData[46] has
ID         |   displayname         |     'Other Important Info'
123456|  ERROR                     |     'Your wife's birthday is 2/18!'

I want to ONLY replace ERROR with the display name (if it was successfully read).

So, how can I update only the ERROR fields in $ImportedData ?
Watch Question
Top Expert 2014
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE