I've been researching this for a month now and have read everything aboutvariables in powershell and get-adobjectI could get my greedy littlehands on. I still don't get it.
I tried to get anemail address from AD, but I couldn't get the commandto return the email address into a variable. It looks like the get-aduser command is not able to find the user because the $owners has thename stored as "John Smith."Can you pleasehelp me understandhow to search AD for a user by a string containing first name space last name when everything in AD is stored last name comma first nameso I can get this thing finished? Am I approaching this wrong? Would it be easier to convert "John Smith" to an email address using "John.Smith@email.com"?I've already tested everything else and verified that it's working. This is the only piece of a much larger script...