Question about New-ADUser -Path

nobody 41 Reputation points
2022-11-01T16:39:10.713+00:00

i want to create users by script (New-ADUser). how do i specify the variable -Path in this case

(windows server 2019)

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,642 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 57,431 Reputation points
    2022-11-01T17:05:55.85+00:00

    Hi @nobody

    You can use -Path such as:

    New-ADUser -Name "ChewDavid" -Type iNetOrgPerson -Path "ou=subunit,ou=unit,dc=contoso,dc=com" -Server lds.Fabrikam.com:50000

    So for your example in your screenshot:

    New-ADUser -Name "ChewDavid" -Type iNetOrgPerson -Path "ou=Group,ou=Students,dc=contoso,dc=com" -Server lds.Fabrikam.com:50000

    https://learn.microsoft.com/en-us/powershell/module/activedirectory/new-aduser?view=windowsserver2022-ps#example-3-create-an-inetorgperson-user

    ------------------------------------------

    If this is helpful please accept answer.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.