• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

Login scripts/automation?!?

Unfortunately I have the task of doing the following this time next year.

1. Renaming the PC windows/DNS host name on the PC.
2. logging the newly created PC into a different domain.
3. Renaming and recreating all NT user accounts on the new domain with a different username makeup %SURNAME, FIRST INITIAL, instead of FIRST INIATIAL SURNAME.

Anyone have any good ideas for automating this via DOS login scripts or any other method.

Oh and i forgot, this needs to be done in a weekend...?!?(250 users/PCS)
1 Solution
Is hsould be possible to do most of this via net use commands
net use /?
See how much of that will work for you and then ask us the remaining questions.
1.  Coudl use ntsid.exe or a modified version to change the computername (www.sysinternals.com) (I have a version that only changes the computername, but simple to modify (all source code available)).  This could be placed in the login script but will need to check the rights of the user logging in first.

2. Use Netdom.exe from ntreskit (or could use ntsid.exe as above)

3.  Use addusers.exe from the ntreskit:

in a batch file :

addusers.exe %LOGONSERVER% /d c:\_txtfile_ > NUL

Then use for command to reprase file to give username in the file you want (for more points I'll do this for you), then use for to cat the group sections intop this new file, then addusers on the new domainserver to add the users back on.

for /f "tokens=1-8 skip=1 delims=," %%a in (c:\_txtfile_) do ECHO some work to create newtxtfile

remember that these user accounts will have new sid's.  If they need to access file resources from the old domain then use scopy.exe (from the ntreskit to copy the files along with the old permissions to the new server), then use subinacl to substitute the old permissions for the new ones.


Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now