Jump to content


anyweb

How can I deploy Windows 8.1 x64 to the Microsoft Surface Pro 3 using System Center 2012 R2 Configuration Manager ?

Recommended Posts

Hi Niall,

 

My organization use to name the computers after the mac address of the pc's. This is done by CustomSetting.ini file [OSDComputername=DP#Right(Replace("MACADDRESS%",":",""),12#]

LP for laptops and TB for tablets. We are in the status where we want to move the OSD from MDT to our SCCM 2012 r2 cu3. Tablets are a different story, if you image multiple tablets with the same docking station you will get the same name for all of them, and we don't want that. For this we use a Power-shell script to rename the tablets to the wireless mac address (we do not have wireless access network in our organization), we use this because the mac address is unique and very handy when you have 70000 pc's to maintain. In our MDT task sequence, we put the script in State Restore/custom folder and he works perfect.

My question is:

Where I can put this script in your TS to make it working?

Here is my PS script:

----------------------------------------------

Function Get-OSCNetAdapterProperty
{
#.EXTERNALHELP Get-OSCNetAdapterProperty-Help.xml

[cmdletbinding()]
[OutputType([system.Management.Automation.PSCustomObject])]
Param
(
#Define parameters
[Parameter(Mandatory=$false,Position=1)]
[string[]]$Name,
[Parameter(Mandatory=$false,Position=2)]
[string[]]$Property,
[Parameter(Mandatory=$false)]
[switch]$IncludeHidden,
[Parameter(Mandatory=$false)]
[switch]$Physical,
[Parameter(Mandatory=$false)]
[switch]$AllProperties
)
Process
{
$results = @()
$netAdapterPropertyNames = @{}
$netAdapterAdvPropertyNames = @{}
$netAdapterAdvPropertyKVP = @{}
#Get Network Adapters and Advanced Properties
if ($Name -ne $null) {
$netAdapters = Get-NetAdapter -Name $Name -IncludeHidden:$IncludeHidden -Physical:$Physical -ErrorAction:Stop
$netAdapterAdvProperties = Get-NetAdapterAdvancedProperty -Name $Name -IncludeHidden:$IncludeHidden -AllProperties:$AllProperties
} else {
$netAdapters = Get-NetAdapter -IncludeHidden:$IncludeHidden -Physical:$Physical -ErrorAction:Stop
$netAdapterAdvProperties = Get-NetAdapterAdvancedProperty -IncludeHidden:$IncludeHidden -AllProperties:$AllProperties
}
if ($netAdapters -ne $null) {
#Populate nested hash table: $netAdapterAdvPropertyKVP
foreach ($netAdapterAdvProperty in $netAdapterAdvProperties) {
$netAdapterName = $netAdapterAdvProperty.Name
$netAdapterAdvPropertyDisplayName = $netAdapterAdvProperty.DisplayName
$netAdapterAdvPropertyDisplayValue = $netAdapterAdvProperty.DisplayValue
if (-not $AllProperties) {
if (-not $netAdapterAdvPropertyKVP.ContainsKey($netAdapterName)) {
$netAdapterAdvPropertyKVP.Add($netAdapterAdvProperty.Name,@{$netAdapterAdvPropertyDisplayName=$netAdapterAdvPropertyDisplayValue})
} else {
$netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyDisplayName,$netAdapterAdvPropertyDisplayValue)
}
} else {
$netAdapterAdvPropertyRegistryKeyword = $netAdapterAdvProperty.RegistryKeyword
$netAdapterAdvPropertyRegistryValue = $netAdapterAdvProperty.RegistryValue
if (-not $netAdapterAdvPropertyKVP.ContainsKey($netAdapterName)) {
if ($netAdapterAdvPropertyDisplayName -ne $null) {
$netAdapterAdvPropertyKVP.Add($netAdapterAdvProperty.Name,@{$netAdapterAdvPropertyDisplayName=$netAdapterAdvPropertyDisplayValue})
} else {
$netAdapterAdvPropertyKVP.Add($netAdapterAdvProperty.Name,@{$netAdapterAdvPropertyRegistryKeyword=$netAdapterAdvPropertyRegistryValue})
}
} else {
if ($netAdapterAdvPropertyDisplayName -ne $null) {
$netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyDisplayName,$netAdapterAdvPropertyDisplayValue)
if (-not $netAdapterAdvPropertyKVP[$netAdapterName].ContainsKey($netAdapterAdvPropertyDisplayName)) {
$netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyRegistryKeyword,$netAdapterAdvPropertyRegistryValue)
}
} else {
$netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyRegistryKeyword,$netAdapterAdvPropertyRegistryValue)
}
}
}
}
#Preapare hash tables for property name verification
$netAdapters | Get-Member -MemberType Property | %{$netAdapterPropertyNames.Add($_.Name,"")}
$netAdapters | Get-Member -MemberType ScriptProperty | %{$netAdapterPropertyNames.Add($_.Name,"")}
$netAdapters | Get-Member -MemberType AliasProperty | %{$netAdapterPropertyNames.Add($_.Name,"")}
#If AllProperties parameter is specified, RegistryKeyword can be used as the property name.
#This is because some advanced properties do not have display name.
if (-not $AllProperties) {
$netAdapterAdvProperties.DisplayName | Select-Object -Unique | %{$netAdapterAdvPropertyNames.Add($_,"")}
} else {
$netAdapterAdvProperties.DisplayName | Select-Object -Unique | %{$netAdapterAdvPropertyNames.Add($_,"")}
$netAdapterAdvProperties.RegistryKeyword | Select-Object -Unique | %{
if (-not $netAdapterAdvPropertyNames.ContainsKey($_)) {
$netAdapterAdvPropertyNames.Add($_,"")
}
}
}
#Parameter value verification for $Property
if (-not [system.string]::IsNullOrEmpty($Property)) {
foreach ($userSpecifiedProperty in $Property) {
if (-not $netAdapterPropertyNames.ContainsKey($userSpecifiedProperty)) {
if (-not $netAdapterAdvPropertyNames.ContainsKey($userSpecifiedProperty)) {
$warningMsg = "$userSpecifiedProperty is not a valid property name."
$pscmdlet.WriteWarning($warningMsg)
}
}
}
}
#Get properties and generate the result
foreach ($netAdapter in $netAdapters) {
$netAdapterName = $netAdapter.Name
$result = New-Object System.Management.Automation.PSObject
#Get all properties unless specific properties are specified
if (-not [system.string]::IsNullOrEmpty($Property)) {
foreach ($userSpecifiedProperty in $Property) {
$propertyValue = $netAdapterAdvPropertyKVP[$netAdapterName].$userSpecifiedProperty
if ($netAdapterPropertyNames.ContainsKey($userSpecifiedProperty)) {
$result | Add-Member -NotePropertyName $userSpecifiedProperty -NotePropertyValue $($netAdapter.$userSpecifiedProperty) -Force
} elseif ($netAdapterAdvPropertyNames.ContainsKey($userSpecifiedProperty)) {
$result | Add-Member -NotePropertyName "$userSpecifiedProperty" -NotePropertyValue $propertyValue -Force
}
}
} else {
foreach ($netAdapterProperty in $netAdapterPropertyNames.Keys.GetEnumerator()) {
$result | Add-Member -NotePropertyName $netAdapterProperty -NotePropertyValue $($netAdapter.$netAdapterProperty) -Force
}
foreach ($netAdapterAdvPropertyName in $netAdapterAdvPropertyNames.Keys.GetEnumerator()) {
$propertyValue = $netAdapterAdvPropertyKVP[$netAdapterName].$netAdapterAdvPropertyName
$result | Add-Member -NotePropertyName $netAdapterAdvPropertyName -NotePropertyValue $propertyValue -Force
}
}
$results += $result
}
}
return $results
}
}

$strFile = "C:\temp\mac.csv"

IF(-not (test-path -Path c:\temp)){New-Item -type directory -Path c:\temp}

# Get details of this computer
$MacAddressOrg = Get-OSCNetAdapterProperty -Name "Wi-Fi" -AllProperties -Property "LinkLayerAddress" | Export-Csv $strFile -NoTypeInformation

# Clean Text file
(Get-Content $strFile) |
ForEach-Object {($_ -replace "-", "")} |
ForEach-Object {($_ -replace "LinkLayerAddress", "")} |
ForEach-Object {($_ -replace """", "")} |
Set-Content $strFile

$MacAddress = Get-Content -Path $strFile | Select-Object -Index 1

Write-Host MACAdress = $MacAddress
$strTabletComputerName = "TB$MacAddress"
Write-Host ComputerName = $strTabletComputerName
Rename-Computer -NewName $strTabletComputerName

---------------------------------------------------------------------------------------------------

If I manually run this script after the image process, it will work. I need this to be inside the TS process. Please help

I already try all I can thing like in the end of State Restore

1. Just run the PS1

2. Apply Windows Settings then PS1 then reboot

3. etc

Share this post


Link to post
Share on other sites

if you add a run powershell script step after the Apply Operating System image step and before the Setup Windows and configmgr step that should work, have you tried that yet ?

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the post but do you have any idea what would cause this issue when trying to omport the drivers?

 

Error: Failed to import the following drivers:
• \\******\drivers$\Windows 8\Surface 3\Intel\SerialIO\1.1.165.1\iaLPSS_GPIO.inf - The selected driver is not applicable to any supported platforms.
\\******\drivers$\Windows 8\Surface 3\Intel\SerialIO\1.1.165.1\iaLPSS_I2C.inf - The selected driver is not applicable to any supported platforms.

I get the sam eerror for quite a lot of different drivers.

 

SCCM 2012 R2 CU4

 

Thanks,

 

Al

Share this post


Link to post
Share on other sites

can you show me a screenshot of that, does smsprov.log reveal anything further ? are you trying the import directly on the primary or on a remote console ?

Share this post


Link to post
Share on other sites

can you show me a screenshot of that, does smsprov.log reveal anything further ? are you trying the import directly on the primary or on a remote console ?

After intense googling I found this guys site:

 

http://www.danrichings.com/

 

I installed the microsoft patches as suggested and it is working fine now. This may well crop up for others who use 2008R2.

 

cheers,

 

Al

  • Like 1

Share this post


Link to post
Share on other sites

hey,

 

is somebody else experiencing issues with the internal clock? And I am not talking about the 3% bug. I have newest Firmware and all patches and occasionally when in standby it sets the clock/date off, sometimes days, sometimes months. This is not solveable through a reboot.

Share this post


Link to post
Share on other sites

if you add a run powershell script step after the Apply Operating System image step and before the Setup Windows and configmgr step that should work, have you tried that yet ?

Yes, it is not working! I believe that he doesn't see the wireless network card (I add the drivers in the WinPE and I put the PS after the drivers and before the setup windows and configmgr)

Share this post


Link to post
Share on other sites

hey,

 

is somebody else experiencing issues with the internal clock? And I am not talking about the 3% bug. I have newest Firmware and all patches and occasionally when in standby it sets the clock/date off, sometimes days, sometimes months. This is not solveable through a reboot.

Try to load the TS with command support enable, then before you start the TS hit F8 and in the CMD type TIME and correct the time once, do the same for DATE and reboot the PC. It works for me!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.