SMP USMT Password

WMUG

WMUG
Windows Management User Group Community blogs

.:: (MVP) Raphael ::.

Your System Center Configuration Manager portal
Social

SMP USMT Password

  • Comments 2

Hi All,

i've worked in a project where I needed to set a password for the USMT file (.mig) when using SMP.

Unfortunately, this is impossible as the password is generated automatically and it is stored in the computer association. using the console, you can get this info...however...

in my scenario, we kept the MIG file for a few of days on the server (7 days) and needed to keep the password in a encrypted text file only in case of we needed to recover any file from the MIG file after it has been deleted from the SMP (of couse, we have a backup of the folder :))

based on this, i've created a powershell script (Yes, powershell...my 1st real powershell script)

a small version of the powershell can is bellow (remember to change the site code)

$SourceComputer = "WIN7TEST78"

$DestinationComputer = "WIN7TEST78"

 

$SourceQuery = "Select ResourceID From SMS_R_System WHERE Active = 1 and Obsolete = 0 and NetbiosName = '" + $SourceComputer + "'"

 

$DestinationQuery = "Select ResourceID From SMS_R_System WHERE Active = 1 and Obsolete = 0 and NetbiosName = '" + $DestinationComputer + "'"

 

$SourceID = Get-WmiObject -Namespace "root\SMS\Site_<SITECODE>" -Query $SourceQuery

 

$DestinationID = Get-WmiObject -Namespace "root\SMS\Site_<SITECODE>" -Query $DestinationQuery

 

 $Query = "select * from SMS_StateMigration where SourceClientResourceID=" + $SourceID.ResourceID + " and RestoreClientResourceID=" + $DestinationID.ResourceID

 

$pStateMigration = Get-WmiObject -Namespace "root\SMS\Site_LOR" -Query $Query

 

Foreach($USMTPassword in $pStateMigration) {

$key = $USMTPassword.GetEncryptDecryptKey()

write-host "Source Computer = " $SourceComputer

write-host "Destination Computer = " $DestinationComputer

write-host "Encryption Password = " $key.key

}

as you can see, I'm not good with powershell, i think i'm still an OLD SCHOOL person that loves vbscript :)

Comments
  • Your ventures in to Powershell are exciting Raph! Nice one

  • yep..but not sure if I like as much as like c# or vbscript...maybe because i know how to dev on these...

    let's see how i get with powershell