Hi All,

I need to run a command called moveuser (replaces the local profile with the
profile of a new user) using script which is distributed via SMS 2003. The
script needs to be run under the security context of a domain admin. I tried
runas but it didn't work. I believe the problem is that the script runs
under security context of Local System account which is not sufficient for
me. The following is the example of runas which did not work. SMS 2003
reports the the script result as success. No error messages are reported. Is
there anyone who would suggest some other way with an example or tell me
where I'm going wrong?

Regards,
Yaman

Dim WshShell
Set WshShell = WScript.CreateObject ("WSCript.shell")
WshShell.run "runas /user:newdomain\administrator " & """" & "moveuser
olddomain\olduser newdomain\newuser" & """"
WScript.Sleep 100
WshShell.SendKeys "P@ssw0rd~"
WScript.Sleep 100
WshShell.SendKeys "~"

Re: Script Question by larroNews

larroNews
Sat Nov 05 09:11:37 CST 2005

Assuming you are running Active Directory you can run moveuser.exe from
a batch file.
Create a new Group Policy Object and under the computer configuration
->Windows settings ->Scripts(Startup/Shutdown) select startup. Click
Show Files. Place the batch/script file and the command in the window.

It will take a reboot for the computers to get the new policy but when
they do because it's located inside the GPO it will run with SYSTEM
permissions.

Good Luck,
Larro