ForensiT Homepage
Forum Home Forum Home > ForensiT Support > Domain Migration
  New Posts New Posts RSS Feed - Suppressing Windows Reboot Prompt
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Suppressing Windows Reboot Prompt

 Post Reply Post Reply
Author
Message
j-sta View Drop Down
Newbie
Newbie


Joined: 10 Sep 2008
Location: Alaska
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote j-sta Quote  Post ReplyReply Direct Link To This Post Topic: Suppressing Windows Reboot Prompt
    Posted: 23 Sep 2008 at 5:42pm
I'm working on getting a script going for migrating users and computers to a new domain.
So far, I've been able to get as far as no prompts except for the Windows pop-up due to the domain change.
Is there any way to suppress this prompt?
I've been looking around, but can't seem to find a way.
 
We're hoping to be able to migrate with as little interaction as possible.
 
Thanks!
Back to Top
Support View Drop Down
Moderator Group
Moderator Group


Joined: 09 Nov 2006
Location: United Kingdom
Status: Offline
Points: 1519
Post Options Post Options   Thanks (0) Thanks(0)   Quote Support Quote  Post ReplyReply Direct Link To This Post Posted: 24 Sep 2008 at 5:57am
Hi,
 
Using the /SILENT switch means that the user will not be prompted to restart their machine - but the machine won't automatically reboot either, so you need to find another way to do this.
 
If you are using a Deployment Kit generated script you can get the machine to reboot automatically (without prompting) by changing the PromptForReboot() function. Replace the existing PromptForReboot() function in the script with the following code:
 
Function PromptForReboot()
    Dim objWMIService, colOperatingSystems, objOperatingSystem
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\.\root\cimv2")
    Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
    For Each objOperatingSystem in colOperatingSystems
        objOperatingSystem.Win32Shutdown(6)
    Next
End Function
 
 
 
Back to Top
j-sta View Drop Down
Newbie
Newbie


Joined: 10 Sep 2008
Location: Alaska
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote j-sta Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2008 at 12:20pm

thanks!  Yes, I am using the deployment kit to generate the script and exe file.

But, I just tried using the /silent switch, and it still prompted for a reboot.  I'm assuming it's popping up because of joining a new domain.  Would it make any difference that I just created a bat file with simply "migrate.exe /silent"?  I wouldn't expect to...

As for rebooting, I had actually commented out the prompt for reboot function, and added my own:

Dim objShell
Dim strReboot, strRebootMessage
strRebootMessage = "Rebooting for DHSS Migration completion"
strReboot = "shutdown.exe -r -t 300 -f"
set objShell = CreateObject("WScript.Shell")
objShell.run strReboot

So that it countsdown instead of an auto reboot.
Something i have noticed, is that after the Windows "System Settings Change" reboot prompt, when I click OK, I get a quick popup stating something about the Administrator account (I'm guessing it's stating that acct will not be migrated since it's not a domain account).
 
little edit here... as for the reboot prompt, I know it's coming from Windows, and due to the domain name change.  So it's definately not an issue with the migration wizard.
 
I know using Microsoft's netdom tool you can remotely rename a computer and prevent any kind of prompt.


Edited by j-sta - 25 Sep 2008 at 12:43pm
Back to Top
j-sta View Drop Down
Newbie
Newbie


Joined: 10 Sep 2008
Location: Alaska
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote j-sta Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2008 at 2:04pm
ok I got it working.
I found the /silent switch needed to be added into the vbs file created.
 
For some reason when I originally started trying to create this, when I unchecked "Do not display error messages" and "enable script debugging messages" the script didn't seem to work.
Even with the created exe file, when it was run, pretty much nothing would happen at all.
 
So in the end, I ended up creating a script leaving those check boxes at default, and then just went through the vbs file and commented out the showdebugmessage lines.
 
Working great so far! Thumbs%20Up
Back to Top
Support View Drop Down
Moderator Group
Moderator Group


Joined: 09 Nov 2006
Location: United Kingdom
Status: Offline
Points: 1519
Post Options Post Options   Thanks (0) Thanks(0)   Quote Support Quote  Post ReplyReply Direct Link To This Post Posted: 25 Sep 2008 at 2:24pm
I'm glad things are working Smile
 
My next suggestion was that we should look at your script - but it sounds like there's no need!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.

This page was generated in 0.063 seconds.