Hi every one i am using the following code to add user to active directory but i am getting the error Directory object not found
$NewUser = Read-Host "New Username"
$firstname = Read-Host "First Name"
$Lastname = Read-Host "Last Name"
$NewName = "$firstname $lastname"
New-ADUser -SamAccountName $NewUser -Name $NewName -GivenName $firstname -Surname
$lastname -Path "ou=Users,DC=mydomain,DC=local" -AccountPassword (Read-Host "New Password"
-AsSecureString)