This script prepares a build for imaging and must be run before the system is shutdown and
imaged. If the machine is rebooted before the image is taken this will have to be run again.
This script determines the bitness (32/64) of the client and proceeds to do the following:
Stops the Services
Removes user base registry keys
Removes local machine base registry keys
Remove Identity Finder Program settings and files from ProgramData (doesn't nuke the directories just the files )
Remove Identity Finder Program settings and files from Current Profile (doesn't nuke the directories just the files )
Adds the registry settings needed to connect to the enterprise console ( attached you must edit these see below )
Source
$64bitlevel=$true
if ((gwmi win32_computersystem).SystemType -like "*X86*") {#if1
$64bitlevel=$false
}#if1
#stop the service
Stop-Service IDFEndpointService
#Nuke User Settings
remove-item -Path 'HKCU:\SOFTWARE\Identity Finder' -Recurse -ErrorAction Continue
#Nuke ID Finder Machine Settings
if ( $64bitlevel ) {
remove-item -Path 'HKLM:\SOFTWARE\Wow6432Node\Identity Finder' -Recurse -ErrorAction Continue
reg import .\64_key.reg
Get-ChildItem 'c:\ProgramData\Identity Finder' -Recurse | foreach {#for1
if ( $_.PSIsContainer -ne $true ) {
Remove-Item ($_.PSPath)
}
} #for1
}
else {
remove-item -Path 'HKLM:\SOFTWARE\Identity Finder' -Recurse -ErrorAction Continue
reg import .\32_key.reg
Get-ChildItem 'c:\ProgramData\Identity Finder' -Recurse | foreach {#for1
if ( $_.PSIsContainer -ne $true ) {
Remove-Item ($_.PSPath)
}
} #for1
#for xp
Get-ChildItem 'c:\ProgramData\Application Data\Identity Finder' -Recurse | foreach {#for1
if ( $_.PSIsContainer -ne $true ) {
Remove-Item ($_.PSPath)
}
} #for1
}
#clean user profile for build
remove-item ($env:UserProfile + '\AppData\Local\Identity Finder') -Recurse