Month: February 2013

Another copy of Configuration Manager Setup is already running

Posted on Updated on

Recently built myself a new server for my home lab and decided to build out a new domain. During the setup process of CM12 SP1 (on Win 2012 with SQL 2012 SP1 CU2), the guest VM hung midway through setup and was completely unresponsive.  So I reset the VM and ran the CM12 SP1 setup again – it only allowed the site to be uninstalled, which I did.  However after immediately trying to install CM12 again, I received error “Another copy of Configuration Manager Setup is already running”.

The fix?

Just restart the server after the uninstall of the site.

another_CM_setup_running

Script to Rename Computer During OSD

Posted on Updated on

In assisting a recent customer implement an upgrade from WinXP to Win7, they requested that the names be changed to fit a new standard as part of the in-place imaging process.  In this particular case, all of the computers had a name that ended with a sequential number (1, 2, 3, …) plus an “A” tacked on at the end.  They wanted the “A” removed and for the PC name just to end with the sequential number.

This was a pretty easy fix to accomplish through a VBScript which

  1. Retrieves the active OSDComputerName task sequence variable
  2. Detects if the last letter is an “A”
  3. Truncates the name to remove the “A”
  4. Re-sets OSDComputerName to the new value

'==========================================================================
' NAME: PCNameStandardization.vbs
' AUTHOR: Nick Moseley, <a href="https://t3chn1ck.wordpress.com">https://t3chn1ck.wordpress.com</a>
' COMMENT: This script will detect if the current computer name ends with ' the letter 'A' so that it can be removed.
'==========================================================================
Option Explicit
Dim oTaskSequence, sComputerName, iNameLength
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")

sComputerName = ucase(oTaskSequence("OSDComputerName")) iNameLength = Len(sComputerName)

If right(sComputerName,1) = "A" Then
oTaskSequence("OSDComputerName") = left(sComputerName, iNameLength-1)
  ' The echo statement is not displayed, but rather registered in SMSTS.log
wscript.echo ">>>> Set OSDComputerName from " & sComputerName & " to " & oTaskSequence("OSDComputerName")
End If

To add this into your task sequence:

  1. Put this script into a package for your general OSD Scripts
  2. Ensure you have the step to capture the computer name
    CaptureWinSettings
  3. Immediately after the capture windows settings, run the PC Standardization Script
    PCNameStandardization
  4. On whatever step you have that prompts for the PC Name, add a condition to not execute if variable OSDComputerName does not exist.  This is so that task sequence will not be held up on the other end waiting for someone to enter a PC name for one you’ve already set.
    PromptPCNameCondition
  5. Finally – ensure ConfigMgr environment is configured to automatically resolve conflicting records!  See this as to why https://t3chn1ck.wordpress.com/2013/02/14/error-initializing-client-registration-0x80040222/

Error initializing client registration (0x80040222)

Posted on Updated on

I recently had a request from a customer to rename their PCs during an in-place upgrade of WinXP to Win7.  I’ve put together some custom scripts to detect the particular qualifying conditions for when the PC needs to be renamed, and these scripts work just fine (this is an upcoming blog post).

The problem that I ran into was that after completion of the task sequence, the CM07 client was unable to register with the site server.  Thereby it wouldn’t receive policies and did not operate.  The client’s ClientIDManagerStartup.log showed “Error initializing client registration (0x80040222)”.  As part of my troubleshooting, I was able to “fix” the client by deleting the old computer record instance and the generate a new GUID on the client.

Credit to one of my colleagues who was able to identify the scenario when I had overlooked it.  The real problem was that since the PC was being renamed, a Conflicting Record was being created since both the old and new instance had the same hardware ID information.  There are two ways to resolve this situation:

  1. Manually resolve the conflicting records
  2. Configure the site to automatically resolve the conflicting records

Option 2 is the most desirable since you can set it and forget it….so that’s we did!

conflictingrecords

 

 

Going to MMS 2013!

Posted on Updated on

I am glad to say that I am going to MMS 2013…
….BUT this time as a speaker!  I’ve been a long time attendee to this fantastic conference, and now it is my privilege and honor to continue to give back to the community in this way.

Augmenting Your Windows Management Strategy with System Center 2012 Configuration Manager Task Sequences

Configuration Manager 2012 has simplified Windows management with the new Application model. However, some systems management challenges are too complex for any general-purpose tool. Come learn how to extend your coverage with Task Sequences to manage your Windows environment. We will cover scenarios detailing when to utilize Applications vs. Task Sequences, demonstrations of how to leverage the versatility of Task Sequences, as well as assorted community solutions.

MMS is the premier conference for learning and advancing in the System Center suite of products (amongst other things).  I highly recommend attending if you can. Early bird registration ends next week, February 13th.  If you do go, be sure to sign up for my session and say hi to me afterwards!  http://www.2013mms.com/topic/details/UD-B303

mms2013

VBScript Disable NIC Power Management Setting

Posted on Updated on

The following VBScript will disable NIC power save features.

'==========================================================================
' NAME: SetNetworkPnPCapabilities
' AUTHOR: Nick Moseley , <a href="https://t3chn1ck.wordpress.com">https://t3chn1ck.wordpress.com</a>
' COMMENT: Parses list of available network adapters to then disable power
' save features.  For more info, see Microsoft KB837058
' VERSION HISTORY:
' 1.0 (05/09/2011) - Initial script
' 1.1 (05/10/2011) - Fixed logical bug within the If statement for Wan/Lan
' 2.0 (05/10/2011) - Added logging into registry for future inventory
' 3.0 (08/17/2011) - Commented out changes to disable NIC power save as
'  this needs to be enabled in order to support WOL
'==========================================================================
Option Explicit
Const ForAppending = 8

Dim oShell, oWMI, colNetworkAdapterItems, sNetworkAdapterReg
Set oShell = CreateObject ("WScript.Shell")
Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
Set colNetworkAdapterItems = oWMI.ExecQuery ("Select * from Win32_NetworkAdapter")
sNetworkAdapterReg = "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"

' Logging
Dim oFSO, oVersionLog
Set oFSO = CreateObject ("Scripting.FileSystemObject")
Set oVersionLog = oFSO.OpenTextFile ("C:\Windows\Temp\NicPower.log", ForAppending, True)
oVersionLog.WriteLine "Configuration of Network Adapters"
oVersionLog.WriteLine "  => Started (" & Date & " " & Time & ")"

' Get all objects and take action on network adapters
Dim oItem, sIndexValue, sLomValue
For Each oItem In colNetworkAdapterItems
If InStr(lcase(oItem.Name),"wan miniport")=0 _
And InStr(LCase(oItem.Name),"microsoft isatap")=0 _
And Trim(oItem.Name)<>"RAS Async Adapter" _
And InStr(LCase(oItem.Name),"cisco")=0 Then
If oItem.Index < 10 Then
sIndexValue = "000" & oItem.Index
Else
sIndexValue = "00" & oItem.Index
End If

' ****************************************
' IMPORTANT: NIC power save as needs to be enabled in order to support WOL
' Configure/disable Power save on NIC
oShell.RegWrite sNetworkAdapterReg & sIndexValue & "\PnPCapabilities", "56", "REG_DWORD"
oVersionLog.WriteLine "  => Disabled network adapter power save on device """ & oItem.Name & """"
oVersionLog.WriteLine "     Set PnPCapabilities (dword) to 38 in " & sNetworkAdapterReg & sIndexValue
' ****************************************

' Configure/enable WAN/LAN switching
sLomValue = ReadRegistryKey (sNetworkAdapterReg & sIndexValue, "LOM")
If sLomValue<>"1"  And sLomValue<>"null" Then
oShell.RegWrite sNetworkAdapterReg & sIndexValue & "\LOM", "1", "REG_SZ"
oVersionLog.WriteLine "  => Enabled WAN/LAN switching on device """ & oItem.Name & """"
oVersionLog.WriteLine "     Set LOM (string) to ""1"" in " & sNetworkAdapterReg & sIndexValue
End If
End If
Next
' Set registry values for SCCM inventory
oShell.RegWrite "HKLM\Software\CompanyName\Image Info\DisabledNICPowerSave", "True", "REG_SZ"

' End
oVersionLog.WriteLine "  => Completed (" & Date & " " & Time & ")"
WScript.Quit (oVersionLog.Close)

Function ReadRegistryKey (sReadKey, sReadValue)
On Error Resume Next
Dim sGetValue
sGetValue = oShell.RegRead (sReadKey & "\" & sReadValue)

If Err.Number <> 0 Then
ReadRegistryKey = "null"
Else
ReadRegistryKey = cstr(sGetValue)
End If
End Function

Failed in WinHttpSendRequest API, ErrorCode 0x2ee7

Posted on Updated on

Ran into a situation where all CM07 clients at a particular site were not installed/active within the ConfigMgr primary site.  Digging into the ccmexec.log file on the clients, errors were generated repeatedly with message “Failed in WinHttpSendRequest API 0x2ee7”.  In this particular scenario, I discovered that the client was attempting to communicate with the MP when the error occurred…and that the server’s name was incorrect.  So instead of trying to reach ServerA01, it was trying to reach ServerA (note the missing zero+one at the end of the name).  Turns out that when the Secondary Site was set up, whomever had created the site mistyped the name.

To fix this, the following needed to happen for me to eventually get this to work.

  1. Update the Secondary Site’s specified FQDN to be the correct name as ServerA01
  2. Uninstall the proxy MP on the secondary
  3. Manually delete the SMS-MP records in the Systems Management container.  I had to do this because for some reason the site didn’t have the correct permissions, even though it really did.
  4. …wait
  5. Reinstall the proxy MP
  6. Regenerate new GUIDs for the clients at the site (I used the SCCM Client Center tool to perform this).  I had to generate the new GUIDs because they were not receiving the corrected FQDN server name on their own.

And within minutes, all was clear and clients were functioning again!