You should not have to enable the user. Creating a new user creates the user enabled.
Since you're using the same password for every user, create the SecureString outside the implied loop of the pipeline and assign it to a variable, e.g., $pw. Then use that variable in the pipeline. It doesn't make sense to call ConvertTo-SecureString over and over again to produce the same results.
It's going to be a lot easier to produce the verbose logging you want with a foreach loop as opposed to trying to jam it into a single pipeline. There's no shame in that. Just do it.
The topic ‘Pipeline input ByPropertyName’ is closed to new replies.