I have 50+ Active Directory users to create and I am attempting to do so with PowerShell. The idea is to have the username contain a number and increment by one through the loop. I'm also attempting to do the same increment with the password. The following script works with the exception of the password. I cannot figure out how to get the password to work.
The ideal result will be the users will be created like this...
Username: Training1 Password: Training1#5076
Username: Training2 Password: Training2#5076
etc, etc, etc,.
I have tried entering a simple string for the $PwCount and it works. I have tried using a variable for $PwCount and it works. And I have tried just entering a string for AccountPassword and it works. Where things break, is when I try to use multiple varialbes, in this case, including the $counter. Each time I attempt to run the script, I receive error: Cannot bind parameter 'AccountPassword'. Cannot convert the "System.Security.SecureString" value of type "System.String" to type "System.Security.SecureString".