you give the option to specify a domain name on the command line e.g.
invoke-adgenerator -domain mydomain.local
but the new-aduser commands in the function AddADuser from line 76 all have the domain mayorsec.local hardcoded into the -path attribute
This is line 86:
New-ADUser -Name "$firstname $lastname" -GivenName $firstname -Surname $lastname -SamAccountName $SamAccountName -UserPrincipalName $principalname@$Global:Domain -Path "OU=SeniorManagement, DC=mayorsec,DC=local" -AccountPassword (ConvertTo-SecureString $password -AsPlainText -Force) -PassThru | Enable-ADAccount
If I create a domain other than your example (which you allow students to do in Invoke-ForestDeploy) I can't then create the users using Invoke-ADGenerator - everything else works, it creates the groups and OU, but not the users
users get the error: New-ADUser : The server is unwilling to process the request
you give the option to specify a domain name on the command line e.g.
invoke-adgenerator -domain mydomain.localbut the
new-adusercommands in thefunction AddADuserfrom line 76 all have the domainmayorsec.localhardcoded into the-path attributeThis is line 86:
New-ADUser -Name "$firstname $lastname" -GivenName $firstname -Surname $lastname -SamAccountName $SamAccountName -UserPrincipalName $principalname@$Global:Domain -Path "OU=SeniorManagement, DC=mayorsec,DC=local" -AccountPassword (ConvertTo-SecureString $password -AsPlainText -Force) -PassThru | Enable-ADAccount
If I create a domain other than your example (which you allow students to do in Invoke-ForestDeploy) I can't then create the users using Invoke-ADGenerator - everything else works, it creates the groups and OU, but not the users
users get the error:
New-ADUser : The server is unwilling to process the request