Solved

Problem with dsadd user syntax in Active Directory

Posted on 2014-11-19
5
327 Views
Last Modified: 2014-12-15
This is the data I need to put in

Username=Magnus
Fullname=Maggi Soffa
Address="My home address"
Password=mypasswd
DNS domain=tsc.local
Organizational Unit= "PPP Users"
Member of group="PPP Notendur"

I have tried
dsadd user cn=Magnus,"ou=PPP Users",dc=tsc,dc=local -disabled no –pwd mypasswd -mustchpwd no -memberof "cn=PPP Notendur","ou=PPP Groups",dc=tsc,dc=local -acctexpires never
0
Comment
Question by:soffcec
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:tshearon
ID: 40452994
You probably just need to move those quotes to the end of your ldap path. Like this:

"ou=PPP Users,dc=tsc,dc=local"
"cn=PPP Notendur,ou=PPP Groups"

Also you can use AD powershell for this:

New-ADUser -name "Maggi Soffa" -displayname "Maggi Soffa" -SamAccountName Magnus -UserPrincipalName Magnus -GivenName "Maggi" -Surname Soffa -StreetAddress "<Your_Street_Address>" -City <Your_City> -State <Your_State> -PostalCode <Your_PostalCode> -AccountPassword (Read-Host -AsSecureString "AccountPassword") -Enabled $true -Path "ou=PPP Users,dc=tsc,dc=local"

This will prompt you for the password. Whether you use a successful password or not the account will still get created. Though if the password is not given or is not a good password per your policy then the account will be there it will just be disabled.
0
 

Author Comment

by:soffcec
ID: 40454041
Still getting some errors

C:\>dsadd user cn=Magnus,"ou=PPP Users,dc=tsc,dc=local" -disabled no -pwd mypass
wd -mustchpwd no -memberof "cn=PPP Notendur,ou=PPP Groups",dc=tsc,dc=local -acct
expires never
dsadd failed:'-pwd' is an unknown parameter.
type dsadd /? for help.
0
 
LVL 8

Expert Comment

by:tshearon
ID: 40454883
It could be that you have some formatting issues with your -. Retype the command in notepad, do not copy and paste from your original. The only thing I can think of is you used MSWord to type out the command and auto-format hot ahold of it and dsadd can no longer understand it.

Also, your quotes are still in the wrong place on your group membership add.

The best bet is to use powershell for this the of thing as I stated in my earlier post. Much more powerful and can be scripted a little easier.
0
 

Author Comment

by:soffcec
ID: 40455023
It works in PS, but I am asked for password.

PS C:\> New-ADUser -name "Maggi Soffa" -displayname "Maggi Soffa" -SamAccountNam
e Magnus -UserPrincipalName Magnus -GivenName "Maggi" -Surname Soffa -StreetAddr
ess "Hlíðarveg 8" -City Grundarfjörður -State Eyrarsveit -PostalCode 350 -Accoun
tPassword (Read-Host -AsSecureString "AccountPassword") -Enabled $true -Path "ou
=PPP Users,dc=tsc,dc=local"
AccountPassword: *******


And do you know if I can also add the static ip address for DialIn ?
0
 
LVL 8

Accepted Solution

by:
tshearon earned 500 total points
ID: 40455381
You can use the script I have attached to pass the password directly as a text string. This is not secure as you are now typing out your password in plain text but since you were doing that anyway I am not sure it matters. Rename the script from *.txt to *.ps1 and then open AD powershell and execute the script in the directory you copied it into by running ./createuser.ps1.

As far as whether you can add a dialin ip to the AD account, I am not aware of any such attribute that exists. Do you mean another attribute possibly like IP Phone number maybe?
createuser.txt
0

Join & Write a Comment

Every now and then, Microsoft does something that totally impresses me. It doesn't happen often, but in this case I must say I am thoroughly impressed with Windows Server Backup. One of the long time issues with Windows Backup has been the ability t…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now