My challenge for the day.
I am importing a csv. Each entry has 4 properties. The first property is completed and I need to use that property to obtain the other properties. I will be doing this in a foreach loop but apparently I don’t quite understand how to get that information into the variable.
When I import my csv ($test) I end up with this:
email SipAddress sAMAccountName Mailbox
somevalue
somevalue
somevalue
somevalue
I was hoping that I could do something like this to fill in the values for SipAddress, sAMAccountName, Mailbox for use later on in the script. And yes they have to be together because at one point I need to take a returned value (Mailbox) and compare it against the variable to be able to pass the sAMAccountName to another command:
foreach ($i in $test)
{$test.sAMAccountName = get-aduser -property sAMAccountName}
I have tried this a couple different ways can’t quite get it. Not sure what I need to do to get the information I want. Maybe create a new variable?