How to Use the Location and Operating System dropdown: Part4 OSDWP

This Post in the Blogpost series is like what is the meaning of Location and Operationg System:

We would like starting at the begining. 😉

Diffrent RessourceID’s

When you plan a Migration from the old SCCM 2007 or another Tool that does OSD we need the Clients in Configuration Manager 2012, but there are some options to do this. Maybe you need the AD System Discovery Method, if you Import the Client Objects from the AD the Objects in CM12 becomes no MAC-Adress and a special RessourceID the RessourceID begins with 20xxxxxxxx (see the Fig. below)

AD Import Nummber 20xxxxxxx

image 

The next option you have, is that you Import the Client (Import Computer Information) as a single Object or from a CSV File. You need the Computername and the MAC adress or the SMBIOS GUID. In this Import scenario the RessourceID of the Object in CM12 begins with 16xxxxxxxx

Singel Import 16xxxxxxx

image

The diffrent between this two Import scenarios is the RessourceID, with a ID that starts with 20xxxxxxxxx you can’t use PXE Boot to start a OS-Deployment like a Tasksequence.

If you import the Clients as a Singel import or a CSV Import you have another problem, there is no way to set a Collection with a query, but there are no Informations in this object, that means we have assign a direct membership, but this clients allredy in this collection.
That is why we have the OSD WebPortal with additional two Attributes in it to assign the objects to the right collection by Query.

Additional Attributes (Properties) for OSDWP

We have to set two additional Attributes if we add a new decive in OSDWP:
image

That attributes are created also in the Computer object, first with a 16xxxxxxxx RessourceID that we can do PXE boot, second that we can do query based collections.

OSD Webportal Import: 16xxxxxxxx

image
The Attributes are existing in the object but they overritten now:

– Location, can be overritten by AD System Discovery
– Operating System Name and Version, overritten by the every HW inventory cycle or DDR File from Client Agent.

Collection structure for OSDWP

We have to build two Collection Structures for OSD WebPortal, one for OS-Deployment and one for Locations. First we build two Folders like Locations and Operatingsystems

For the OSD we create for every OS and maybe Build Version a Collection the Limiting to Collection in this example is “All Systems”

image
image

Operating System Collection

Here is also a PS example to create the OS Collections:
Please set in the “” the name vor OS, like Windows 8, and cahnge the Sitecode XYZ to Your Site code.
If you change the OS Variable you have also to change the Name in the query, all marked in red

$OS = ""
$Arguments = @{Name = "$OS"; OwnedByThisSite = $True; LimitToCollectionID = "SMS00001"; CollectionType = 2; RefreshType = 4}
Set-WmiInstance -Namespace "Root\SMS\Site_XYZ" -Class SMS_Collection -Arguments $Arguments

Add-CMDeviceCollectionQueryMembershipRule -CollectionName "$OS" -RuleName "$OS" -QueryExpression 'select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion = "Windows 8"

With this script you can Build so many Collections with querys that you need.

In the next step you have the files like xml in your OSDWebPortal Folder under “C:\inetpub” one for OS and one for Locations.

image 
 
You can change the Operatingsystems.xml with your Collections

   1: <?xml version="1.0" encoding="utf-8"?> 

   2: <!--use this file to configure the available operatingsystems--> 

   3: <!--ID will be written to SCCM and the element-value is used to display in the web-interface--> 

   4: <OperatingSystems> 

   5:   <OS ID="Windows 7">Windows7</OS> 

   6:   <OS ID="Windows 8">Windows 8</OS> 

   7:   <OS ID="Windows 8.1">Windows 8.1</OS> 

   8:   <OS ID="Windows 2012">Windows 2012</OS> 

   9:   <OS ID="Windows 2012 R2">Windows 2012 R2</OS> 

  10: </OperatingSystems>

remember: The ID attribute references the value which will be written to ConfigMgr (Collections Name) and the element value is used to display on the webportal.

Locations Collection

Here is also a PS example to create the Locations Collections:

Please set in the “” the name vor Locations, like Switzerland, and cahnge the Sitecode XYZ to Your Site code.

If you change the Locations Variable you have also to change the Name in the query, all marked in red

$Location = ""
$Arguments = @{Name = "$Location"; OwnedByThisSite = $True; LimitToCollectionID = "SMS00001"; CollectionType = 2; RefreshType = 4}
Set-WmiInstance -Namespace "Root\SMS\Site_XYZ" -Class SMS_Collection -Arguments $Arguments

Add-CMDeviceCollectionQueryMembershipRule -CollectionName "$Location" -RuleName "$Location" -QueryExpression 'select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Location = "Switzerland"

additional you can set also the Collection Variables at the same time:
New-CMDeviceCollectionVariable -CollectionName "$Location" -variableName "OSDWP_InputLocale" -VariableValue "de-CH"
New-CMDeviceCollectionVariable -CollectionName "$Location" -variableName "OSDWP_SystemLocale" -VariableValue "de-CH"
New-CMDeviceCollectionVariable -CollectionName "$Location" -variableName "OSDWP_UserLocale" -VariableValue "de-CH"
New-CMDeviceCollectionVariable -CollectionName "$Location" -variableName "OSDWP_UILanguage" -VariableValue "de-DE"
New-CMDeviceCollectionVariable -CollectionName "$Location" -variableName "OSDWP_UILanguageFallback" -VariableValue "de-DE"

The Variable on the Locations Collections are easy to use the Locations for Regional settings. Or Maybe you would like seperate Department or Teams to assign diffrent Softwares in the running of the Tasksequnce, there are so many possibilities ready to use, feel free 😉

 
Also for the Locations you have a xml File that you can optimize for your environment

also in your OSDWebPortal Folder under “C:\inetpub”.

image 
 
You can change the Locations.xml with your Collections

   1: <?xml version="1.0" encoding="utf-8"?> 

   2: <!--use this file to configure the available locations--> 

   3: <!--ID will be written to SCCM and the element-value is used to display in the web-interface--> 

   4: <Locations> 

   5:   <Location ID="United States">United States</Location> 

   6:   <Location ID="Canada">Canada</Location> 

   7:   <Location ID="UK">UK</Location> 

   8:   <Location ID="China">China</Location> 

   9:   <Location ID="Japan">Japan</Location> 

  10: </Locations>

remember: The ID attribute references the value which will be written to ConfigMgr (Collections Name) and the element value is used to display on the webportal.

The diffrent Poweshell scripts should be ready as examlpes asap in the Download Sources on technet gallery

Test the scripts first in your test lab bevor use it in productive!


Comments

Leave a Reply

Follow

Get every new post delivered to your Inbox

Join other followers:

%d bloggers like this: