I have a powershell script that creates a shared mailbox and then assigns a user to it as well as send as permissions. The $UserName value will need to be replaced by a value in a text file. There can be 20 names in the text file (each line is a user).
How do I write the script so I can load the contents of the file into an array and then use a forEach to iterate through it to replace the $userName variable with the name (or value) in the text file?
I haven’t tried anything yet.
ISDPCMAN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.