“The directory name is invalid”

You’ll have an mmc on the desktop or a shortcut to AD where you RUN AS and get the “The directory name is invalid”.

Here is a fix for the AD shortcut issue

http://support.microsoft.com/kb/832434

Right click on the AD shortcut in properties and in the Start In put

%windir%

Fix for the MMC is to give the RUNAS user account permissions to the location of the MMC. If it’s on your desktop, then give permissions there. Not just to the icon, but the whole desktop folder or even the whole profile folder.

The message basically means that RUNAS user doesn’t have permissions to that location. Shit error message but that’s what it means.

Add several users in AD using Excel

UPDATE – I’ve changed the link below to point to GE.TT a legit file sharing site.

MassUserCreationScriptSource.xls

Link to the script

Taken from Train Signal AD 2008 training.

File needs to be saved as a Formatted Text (Space delimited) file once done.

Here’s the easy way to add a bunch of users all at once!
1. Copy and paste the first and last names of your users into the AddUsersInfoHere sheet
2. Type the ChildOU name and Autofill it down.
3. Type the ParentOU name and Autofill it down.
4. Go to MassUserCreationScriptSource and check to see if the domain name and suffix are correct. If not, fill in
correct value on the first line and Autofill down.
5. On the SaveThisSheetAsTextFile sheet, make sure to autofill for all required user names.
6. Go to File–> Save As and save the sheet in a convenient place, making sure to select Formatted Text (Space Delimited)
as the file type.
7. Take your .prn file, rename it to something.bat.
8. Post to your server and run it at the command line!

Command line batch for adding users in AD

In notepad type

dsadd user “cn=%1, ou=OUName, dc=YourDomain, dc=YourSuffix” -fn %2 -ln %3 -pwd fred -mustchpwd yes

Save as a bat file.

cn = command name (user name)
fn = first name
ln = Last name

Everything in bold you replace with your own info.

Name the file whatever, like adduser.bat

Example:

adduser testdummy Test Dummy

Would add the user Test Dummy