Jump to content

wait for network to join the domain using netdom


Recommended Posts

Hello everyone!

I've got a bit of problem. when i want to join domain during guirunonce section, windows xp won't wait for network. so my net dom command can't run properly. Is there anyone know slove this? I use sysprep and wsname to rename the name according to mac address. then machine restart. login automactically. but due to nature of xp, it will load the shell before networking is ready. that's where i stuck. i try using gp to disable fast login. any idea?

Link to comment
Share on other sites

Try using a runonceex string of commands to join the domain, and use the following vbscript before you run your .cmd that joins the domain to determine network access is available before running the .cmd:

Dim sTestPath
Dim intCount

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objVolatileEnv = objShell.Environment("VOLATILE")

' An UNC path here that will be available when network connection is in place
sTestPath = "\\server\share"
intCount = 1

' test on volatile environment variable to avoid running script
If Not objVolatileEnv("LogonScript") = "Done" Then

Do Until objFSO.FolderExists(sTestPath)
' sleep 5 seconds
WScript.Sleep 5000
intCount = intCount + 1
If intCount = 240 Then
MsgBox "Unable to connect to network share for 20 minutes. Please notify your network administrator."
Exit Do
End If

' share/folder available on server now, so continue

End If

Once the vbscript detects that it can access "\\server\share", it exits and the next command in your RunOnceEx key gets executed. Very simple script, but yet very powerful (especially for RIS or network installations).

Edited by cluberti
Link to comment
Share on other sites

I use in my batch this code (a bit poor but works)

@echo off
rem Define the time to wait ...
set x=4
echo Waiting the network ...
ping -n x >NUL
(rest of code)

cluberti's solution is more professionnal :thumbup

Edited by sonic
Link to comment
Share on other sites

I put a sleep command in my batch file for 90 seconds while the workstation service starts completely.

Echo Waiting 90 seconds for the Workstation Service to start...

Sleep 90

Echo =======================================
Echo Joining computer to mydomain Domain, please standby...
Echo =======================================
ECHO. >>%systemroot%\setuplog1.log

netdom join %ComputerName% /domain:mydomain /userd:mydomain\user1 /passwordd:4password111

Link to comment
Share on other sites

:( Thank you all for your advice. I used the vbscript in my image. Now my image deployment is automatic apart from little problem related to Nlite. When I install my template pc, I used nlited xp pro sp2 integrated with office2k3, acrobat reader, winrar,java and some other programs. After I sysprep my image, during minisetup, I received the error message c_xxxx.nls file missing. When I put the file in i386 folder in sysprep folder, I received more missing fon file errors. If I click on cancel in the first place it goes on like nothing happened. After networking installation stage, another dll file missing error again. Apart from those errors, the rest is fine. If I use normal OS CD, no error messages appear. I searched in the forum. I found someone say copy i386 folder and change 2 registry keys. But if I copy i386 folder, my image will be huge. Any idea! :}
Link to comment
Share on other sites

I'm not sure there's any other way to do it, short of using a different deployment method such as RIS (or riprep). Have you tried replacing those .dll files until you get no errors during installation, or does the installation always complain about missing files no matter what you replace?

Link to comment
Share on other sites

I have done some more testing and on a disc that I burned with Disc At Once, worked flawlessy, then had some errors, worked flawlessly, and it still has worked...

I also burn at 4X just to make sure, but that is an odd error. For me, the CD's I burned faster 52X had a greater rate of the error message. It was always a different file... I am not sure what else you can do, except burn slower... because I cannot always replicate the issue.

It has to do with the Laser, CD-R, or HD.... it is one of those variables that is causing it... You could try different CD-R's...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...