Skip to content

Domain is hard coded in New-ADUser #6

Description

@blue-team-notes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions