Hi
I've done a script to force remove of old DCs.
I'm using NTDSUTIL command line tool for that, and it's working like I
want, except under Windows 2008 (DC)!
I'm unable to read output until command (ntdsutil) has exited. But it's not
what I want, because other inputs depends on previous output.
Question: How can I have a live output read (like under Windows 2003 DC)?
or is their another way to force DC removal (by scripting)?
Here is a sample of my script:
Set WshShell = CreateObject("WScript.Shell")
strCmd = "cmd /c ntdsutil ""popups off"" ""me c"" co ""co to se %
computername%"" q ""se op ta"" ""list sites"""
Set oExec = WshShell.Exec(strCmd)
tmpline = ""
While Not oExec.StdOut.AtEndOfStream
tmpline = LCase(oExec.StdOut.ReadLine)
....
....
' some output analyse...
' and sometimes, I've to send new command, like this one:
oExec.stdIn.WriteLine "select site " & siteSelection
....
....
WEnd
Thanks for your help
Vincent
[FR]
|