From the previous post you have learned how to create SCCM Site role with a script. But how to find out the required values for the System Role settings?
What we will need is any WMI Object Viewer, for example Microsoft WMI Object Browser, which can be downloaded from here.
Install Microsoft WMI Administrative Tools and open WMI Object Browser
Navigate to the namespace \\YOURSCCMSERVER\root\SMS\site_YSC (YSC = your site code)
Create a new distribution point using Configuration Manager Console, specify all required settings. Now we will use this DP as a template.
In WMI Object Browser click on the binocular and find the class called SMS_SiteControlFile
Expand SMS_SiteControlFile and then expand SMS_SCFToSCI_a.SiteControlItem link. Now you should be able to see all site control items.
Scroll down to your “template DP” and highlitght it
Check out properties and their values. This is what you should put in your code
$role.NALPath = "[`"Display=\\$newBDPName\`"]MSWNET:[`"SMS_SITE=$sitecode`"]\\$newBDPName\"
$role.NALType = "Windows NT Server"
$role.RoleName = "SMS Distribution Point"
$role.SiteCode = $sitecode
To see SMS_EmbeddedProperty or SMS_EmbeddedPropertyList values click on the corresponding Array button then browse every object. For example we have set up D: drive as a branch DP disk patition and are now browsing for the corresponding setting. Here it is:
And the corresponding code would be:
$embeddedproperty_class = [wmiclass]""
$embeddedproperty_class.psbase.Path = "\\$ComputerName\root\sms\site_$($sitecode):SMS_EmbeddedProperty"
$embeddedproperty = $embeddedproperty_class.createInstance()
$embeddedproperty.PropertyName = "DPDrive"
$embeddedproperty.Value = 0
$embeddedproperty.Value1 = "D:"
$embeddedproperty.Value2 = ""
$roleproperties += [System.Management.ManagementBaseObject]$embeddedproperty