OPTION EXPLICIT
Const HKEY_LOCAL_MACHINE = &H80000002
CONST DOMAIN_1 = "S-1-5-21-201984988-1065288358-6498272"
CONST DOMAIN_2 = "S-1-5-21-1801674531-287218729-1417001333"
CONST SOCIO = "S-1-5-21-4022628636-557937884-229186324"
CONST DOMAIN_3 = "S-1-5-21-3092697477-4161091300-4181066580"
CONST DOMAIN_4 = "S-1-5-21-3657459247-2099063673-4229756704"
CONST DOMAIN_5 = "S-1-5-21-1670936466-1143696096-740312968"
CONST DOMAIN_6 = "S-1-5-21-3736358454-1868704084-1822373674"
Dim
strComputer,objRegistry,strKeyPath,objSubkey,arrSubkeys,strValueName,strSubPath,strValue,
return, bDelete, KeyToDelete, objSysInfo,strDomain
strComputer = "."
Set objRegistry=GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
For Each objSubkey In arrSubkeys
bDelete = FALSE
''Wscript.Echo "Parsing SubKey " & objSubkey
KeyToDelete =strKeyPath & "\" & objSubkey
'IF Instr(1,objSubkey,DOMAIN_1,1) > 0 Then
' bDelete = True
'End If
IF Instr(1,objSubkey,DOMAIN_2,1) > 0 Then
bDelete = True
End If
'IF Instr(1,objSubkey,SOCIO,1) > 0 Then
' bDelete = True
'End If
IF Instr(1,objSubkey,DOMAIN_3,1) > 0 Then
bDelete = True
End If
IF Instr(1,objSubkey,DOMAIN_4,1) > 0 Then
bDelete = True
End If
IF Instr(1,objSubkey,DOMAIN_5,1) > 0 Then
bDelete = True
End If
IF Instr(1,objSubkey,DOMAIN_6,1) > 0 Then
bDelete = FALSE
End If
If bDelete = True Then
Return = objRegistry.DeleteKey(HKEY_LOCAL_MACHINE, KeyToDelete)
If (Return = 0) And (Err.Number = 0) Then
'Wscript.Echo VBTab & KeyToDelete & " DELETED"
Else
'Wscript.Echo VBTab & "DeleteKey failed. Error = " & Err.Number
End If
Else
'Wscript.Echo VBTab & KeyToDelete & " SKIPPED"
End If
Next
On Tue, Jul 22, 2014 at 8:40 AM, Giroux, Eric J <[email protected]> wrote:
> I have dealt with an issue similar to this after QMM migrated users from
> one domain to another. The key for the OSD was to ensure the task sequence
> was not running while a migrated user was logged on. Had to add a reboot
> prior to USMT steps.
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Burke, John
> *Sent:* Monday, July 21, 2014 9:48 AM
> *To:* [email protected]
> *Subject:* [MDT-OSD] Domain AD Migrated via Quest tool - NOW USMT won't
> let me work.
>
>
>
> Trying to migrate a domain that was still at xp, but the issue likely
> occurs windows7 to windows 7 too. The state capture step fails with
> 0x8007001a
>
>
>
> Capture User State
>
> State Capture
>
> 11135
>
> The task sequence execution engine failed executing an action
>
> -2147024870
>
> e.log"
> /progress:"C:\WINDOWS\system32\CCM\Logs\SMSTSLog\scanstateprogress.log"
> /i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\unsecure.xml"
> /i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\MigApp.xml"
> /i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\MigDocs.xml/i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\MigUser.xml"
> /i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\migEPF.xml"
> /i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\MigEEPC.xml"
> /i:"C:\_SMSTaskSequence\Packages\NS20015C\x86\Exclude.xml" /nocompress
> /hardlink /ui:S-1-5-21-758742814-1263097602-310601177* /ue:QC700406\*
> Log messages are being sent to
> 'C:\WINDOWS\system32\CCM\Logs\SMSTSLog\scanstate.log'
> Starting the migration process
> Error while trying to start the migration process Failed.
> Software malfunction or Unknown exception
> See the log file for more information. ScanState return code: 26
> USMT returned exit code (0x0000001a). Look USMT log file scanstate.log for
> detail error message.
> POSDMigrateUserState finished: 0x8007001a
>
>
>
>
>
> working on getting a fresh set of the scanstate logs. I lost the logs
> because to get around this i can connect to the system and delete the
> Profiles entries in the Profiles registry key or delete the profile from
> the system. These users seem to have a new profile that points at an older
> profile on the system.
>
>
>
>
>
> anyone run into this kinda thing before?
>