Nitrous270
Technical User
I have this piece of my code that is calling netdom to remove the PC from a domain and put it into a workgroup.
The first time I execute the script it acts like it disjoins it from the domain. However, when I look at My Computer > Properties and the Network Identification tab the PC is still joined to the domain. Then if I run the script a second time and check the Network ID tab again it will be in the workgroup.
Any thoughts as to why the script does not do what its supposed to the first time but does the second time?
Thanks in advance
Call WshShell.Run("c:\sysprep\cmd.exe /c NETDOM REMOVE " & strPCName & _
" /Domain:" & strDomain & " /UserD:" & strDOMAIN_USER & " /PasswordD:" & _
strDOMAIN_PASSWORD, 0, True)
Also note that cmd.exe and netdom.exe are both located in c:\sysprep
The first time I execute the script it acts like it disjoins it from the domain. However, when I look at My Computer > Properties and the Network Identification tab the PC is still joined to the domain. Then if I run the script a second time and check the Network ID tab again it will be in the workgroup.
Any thoughts as to why the script does not do what its supposed to the first time but does the second time?
Thanks in advance
Call WshShell.Run("c:\sysprep\cmd.exe /c NETDOM REMOVE " & strPCName & _
" /Domain:" & strDomain & " /UserD:" & strDOMAIN_USER & " /PasswordD:" & _
strDOMAIN_PASSWORD, 0, True)
Also note that cmd.exe and netdom.exe are both located in c:\sysprep