Change PXE Password on all DP’s

Change PXE Password on all DP’s
4.67 (93.33%) 3 votes

Have you ever tried to change the PXE password for your DP’s??

it is easy isn’t it?!?!?! go to the properties of your DP and change the password there…

but if you have 100+ DP’s, it will take a bit of time, don’t it?

This is what happen with a good friend of mine and he asked help…

if you’re in the same situation, the following powershell script is here to help :), you’ll only need to change the sdkserver, sitecode and password to the values you want


$passwordclass = [wmiclass]””
$passwordclass.psbase.Path = “\\” + $sdkserver + “\ROOT\SMS\site_” + $SiteCode + “:SMS_Site”

$inParams = $passwordclass.GetMethodParameters(“EncryptDataEx”)
$inParams[“Data”] = $password
$inParams[“SiteCode”] = $SiteCode
$outParams = $passwordclass.InvokeMethod(“EncryptDataEx”, $inParams, $null)
$PXEpassword = $outParams.EncryptedData.ToString()
#Write-Output “PXE Password is set to the following encrypted value: ” $PXEpassword

$listofDP = gwmi -computer $sdkserver -namespace “root\sms\site_$sitecode” -query “select * from SMS_SCI_SysResUse where RoleName = ‘SMS Distribution Point'”
foreach ($dp in $listofDP)
$dpname = $dp.NetworkOSPath -replace(“\\”,””)

$dp = gwmi -computer $sdkserver -namespace “root\sms\site_$sitecode” -query “select * from SMS_SCI_SysResUse where NetworkOSPath = ‘\\\\$dpname’ and RoleName = ‘SMS Distribution Point'”

$props = $dp.Props
$prop = $props | where {$_.PropertyName -eq $property}

$prop.Value = 0
$prop.Value1 = $PXEpassword
$prop.Value2 = $null

$dp.Props = $props

hope this will help you



Recent Posts

Comments are closed.
%d bloggers like this: