Oct 22, 2010

How to remove and rebuild a SMS 2003 (SCCM 2007) secondary site

To manually stop and remove the failed secondary site, follow these steps:
  1. Click Start, point to All Programs, point to Systems Management Server, and then click SMS Administrator Console.
  2. Locate the Site Settings\Addresses subtree.
  3. Right-click the address for the failed secondary site, and then click Delete.
  4. To use the Preinst.exe tool on the SMS parent site to delete the failed secondary site from the database, follow these steps: 
  5. On the SMS primary site (parent) computer, click Start, and then click Run.
  6. Type cmd in the Open box, and then click OK.
  7. At the command prompt, type cd\, and then press the ENTER key.
  8. Type cd sms\bin\i386\00000409, and then press the ENTER key.
  9. Type Preinst /DELSITE SiteCode ParentCode, and then press the ENTER key.

    NoteSiteCode is the site code of the secondary site, and ParentCode is the site code of the parent site.
  10. To remove any pending or active jobs to a site, type Preinst /DELJOB SiteCode , and then press the ENTER key.

    NoteSiteCode is the site code of the secondary site. For more information about how to use the PREINST tool, click the following article number to view the article in the Microsoft Knowledge Base:
    212978  (http://support.microsoft.com/kb/212978/ ) Description of Preinst.exe for Systems Management Server 2.0
  11. To make sure that the secondary site is completely removed, follow these steps:
    1. Make sure that no SMS or Winmgmt services are running on the computer, including the SMSBootstrap service. If these services are running, stop the services, and then change the Startup type to Manual.
    2. Use Registry Editor to make sure that the following SMS registry keys are removed:
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NAL
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Executive
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Site_Component_Manager
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Bootstrap
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CLISVC
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Discovery_Data_Manager
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Lan_Sender
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Scheduler
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Site_Backup
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Software_Metering_Processor
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMS_Status_Manager
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_CLISVC
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_SMS_BOOTSTRAP
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_SMS_EXECUTIVE
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_SMS_HARDWARE_INVENTORY_AGENT_SERVICE
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_SMS_KEY_CREATION_SERVICE
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_SMS_SERVER_BOOTSTRAP_servername
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_SMS_SITE_COMPONENT_MANAGER
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SMS Client
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SMS Performance Data Provider
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SMS Provider
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SMS Remote Control
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SMS Server
      • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\SmsClient
    3. Make sure that the following folders are removed:
      • X:\SMS
      • X:\SMSBootstrap.log
      • X:\SMSBootstrap.ini
      • X:\SMSBootstrap.pkg
      • %Winnt%\MS\SMS
      NoteX is the SMS installation drive.

      Note You may have to restart the computer to remove some of these files and folders.
    4. Make sure that the CAP_SiteCode and SMSPKGdrive$ shares and their corresponding folders are deleted from the client access point computers.

      NoteSiteCode is the site code of the secondary site, and drive is the drive letter.
    5. Make sure that any site-specific accounts or groups are deleted, including the SMS_SiteSystemToSiteServerConnection_sitecode and SMS_SiteToSiteConnection_SiteCode groups.

      NoteSiteCode is the site code of the secondary site.
    6. Remove the following objects from Internet Information Services (IIS) Manager (if they exist).

      Under Application Pools (only on IIS 6.0):
      • CCM Server Framework Pool
      • SMS Distribution Points Pool
      • SMS Management Point Pool
      • SMS Server Location Point Pool
      Under the default Web Site (on IIS 5.0 or IIS 6.0):
      • CCM_Incoming
      • CCM_Outgoing
      • CCM_System
      • SMS_DP_
      • SMS_MP
      • SMS_SLP
    7. Restart the server.

      Note The server must be restarted to make sure that any of the SMS services that you deleted from the registry in step 6b are no longer running. If these services are still running when you try to reinstall the secondary site, the Setup program will try to remove these services, but the removal will fail because they are already gone from the registry.
After these items are removed, you can reuse the site code to reinstall the secondary site.

How to rebuild the secondary site

  1. Reinstall the secondary site. As soon as possible, the secondary site installation should be started to minimize the effect on clients.

    To speed the installation, see the "Installing a Secondary Site Using SMS Setup" topic in the SMS 2003 Deployment Guide . To obtain this guide, visit the following Microsoft Web site:
    http://technet.microsoft.com/en-us/library/cc181264.aspx (http://technet.microsoft.com/en-us/library/cc181264.aspx)
    This section explains how to set up the site directly from the CD-ROM. This step lets you bypass the 76 megabyte (MB)-network installation package and to install directly from the CD-ROM.

    Important If you use Standard security, verify that the correct accounts and passwords have been specified. Problems can be very difficult to diagnose and repair and may require that you repeat the procedure. To make sure of success, test the account beforehand. To do this, log on to the new primary site by using the specified account, and then connect to the secondary site's c$, d$, and admin$ shares. Create, read, and write to folders and files from the secondary site drives to the primary site drives and back again.
  2. Reconfigure the secondary site. Immediately after you install the secondary site and while the site configuration update is being propagated to the parent site, use the SMS Administrator MMC to configure settings that will prevent clients from having to unnecessarily change their configuration.

Error 0x80131107, Trying to install Microsoft .NET Framework 2.0

  1. Download the .NET Framework cleanup tool and choose to clean up the version of the .NET Framework that is causing problems on your system
  2. Download and install the version of the .NET Framework that you cleaned up in step 1 (such as the .NET Framework 1.0, .NET Framework 1.1 or .NET Framework 2.0)
  3. (optional) Download and run the .NET Framework verification tool to double-check that all .NET Framework files are correctly installed
  4. Download and install the desired .NET Framework service pack (such as .NET Framework 1.0 SP3 or .NET Framework 1.1 SP1) by running the setup package directly instead of using Windows Update.  Running it directly will allow the service pack setup to display error dialogs instead of having Windows Update suppress them

Oct 21, 2010

Duplicate PC's or GUIDS in my SCCM (ConfigMgr)

Have you ran across where you keep seeing PC's show up in your Collections with duplicate names and every time you update and refresh the collection you'll see a different set of PC's show duplicates.
Sample
 DuplicatePC
I was seeing this happen while at a customer and it turned out they imaged a machine with ghost and then used that image over and over and over. Well, if they don't prep that machine correctly with sysprep and the have the SCCM or SMS client already installed, this will cause a problem that you could be tracking down for days.


To resolve this issue, let's see how many duplicates you have. Create a collection and add the following 3 queries as part of the collection. Then update and refresh your collection.
Query 1
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 ClientVersion = "2.50.4160.2000" or Client is NULL
Query 2
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 join SMS_G_System_System on
SMS_R_System.ResourceID = SMS_G_System_System.ResourceID where
SMS_R_System.Name <> SMS_G_System_System.Name
Query 3
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.ResourceID 
in (select SMS_GH_System_System.ResourceID from SMS_G_System_System
join SMS_GH_System_System on SMS_G_System_System.ResourceID =
SMS_GH_System_System.ResourceID where SMS_G_System_System.Name <>
SMS_GH_System_System.Name)
Now you should have a list of machines showing duplicate GUIDS in your database. Just FYI, this isn't always the most accurate, but this allows you a starting place to attach the problem.
Next let's start attacking the problem, you know everyone has to start somewhere.
  1. Create some scripts to fix this issue
  2. Now create these batch files:
    • "CallFinalProcess.bat"
                         Call FinalProcess.bat
                    Call FinalProcess.bat
                    Call FinalProcess.bat
                    Etc….
    • "FinalProcess.bat"
      echo starting the FixMyGuid batch file 1copy /Y D:\DATA\Package$\FixMyGUID\fixmyguid.bat \\%1\c$.\PSTools\psexec -accepteula \\%1 -u deops\ -p /s c:\fixmyguid.bat
    • "FixMyGuid.bat"
      @echo off
      echo starting the FixMyGuid batch file 2
      echo copy sleep.exe file
      copy /Y \\\package$\FixMyGUID\sleep.exe %windir%
      sleep 10 /quiet
      echo copy tranguid.exe file
      copy /Y \\\package$\FixMyGUID\tranguid.exe %windir%
      rem sleep 10 /quiet
      echo copy CCMDelCert.exe file
      copy /Y \\\package$\FixMyGUID\CCMDelCert.exe %windir%
      sleep 10 /quiet
      echo running CCMDelCert to repair GUID
      %windir%\CCMDelCert.exe
      sleep 10 /quiet
      net stop ccmexec
      net start ccmexec
      rem
      rem @echo rebooting workstation in 20 seconds
      rem \\ name>\package$\FixMyGUID\Pstools\PSSHUTDOWN -r -f \\ name>
  3. Now you have the Duplicate GUIDS collection created. Downloaded the files required to reset the GUIDS in the SMSCFG.INI file and created the scripts to download certain files and run exe's on the workstation to resolve the issue. What I would have liked to add is the last scripts a command to restart the workstation. If your calling the script and you know that no one is on that pc, you can remove the REM commands at the end. We're nearing the end of the process, we need do the following to prepare for deployment.
    • Go to SCCM Reports and run report #130 from the Duplicate GUIDS collection.
    • Export the list to a CSV file and clean the file up.
    • Then add "Call FinalProcess.bat" before the computer name as shown in #2.
    • Copy and Paste the list to the CallFinalProcess.bat file
    • Open a CMD Prompt and run CallFinalProcess.bat file form the server.
  4. On average you'll have to give the machines at least 5 minutes to update before you'll see the difference on SCCM. Nothing will hurt if you would like to update and refresh the Duplicate GUID collection. Also, you may have to run the process several times throughout a week or more since some laptops will be disconnected or not turned on.

Oct 20, 2010

Duplicate SCCM Client GUIDs / Full Client Reinstall

This was an issue that I came across from our recent upgrade from SMS 2003 to SCCM 2007.  While we were still using SMS, some systems had been cloned/p2v’d from a production system to a virtual then renamed.  It wasn’t caught at the time, but it appears SMS may have been unable to automatically give the cloned SMS clients a new GUID.  When we migrated to SCCM, these clients were fighting over which of them was the real and live system in SCCM, such that some client records would suddenly disapper from the console…then if they’re client was fixed, a different client record would disappear.
However, simply uninstalling/reinstalling the SCCM client was not resolving the issue.  After some digging around, I found a couple of utilities to help rip out the SCCM client and force a new GUID to be assigned.  I brought these utilities together and created a simple executable to coordinate the process.  This was created with the old, but very reliable, SMS Installer, the code below is for that, but can easily be rebuilt as a vbscript.
If you have any questions about this process, feel free to leave me a comment and I can respond!


  1. On your computer, download and install the SMS 2003 Toolkit v2
  2. In the directory containing your SCCM client install, create a subdirectory (such as “SOURCE”)
  3. From the Toolkit directory, copy ccmdelcert.exe and tranguid.exe to the newly created subdirectory in previous step
  4. In the SCCM client install directory, create an executable or script that does the following in order
    • Execute ccmdelcert.exe (wait for process termination)
    • Delete the file %WINDIR%\SMSCFG.ini
    • Execute ccmsetup.exe /uninstall (wait for process termination)
    • Delete directory %WINDIR%\system32\ccm\
    • Delete registry key HKLM\SOFTWARE\Microsoft\CCMSetup
    • Delete registry key HKLM\SOFTWARE\Microsoft\SMS
    • Execute ccmsetup.exe (wait for process termination)
Below is the ‘code’ for the SMS Installer executable that I built to facilitate this.
Document Type: IPF
item: Check Disk Space
end
item: Set Variable
  Variable=ROOT
  Value=C:
end
item: Get Environment Variable
  Variable=WINDIR
  Environment=WINDIR
end

Oct 19, 2010

Opalis: common errors while deploying an action server

in this post, I'm capturing a list of error messages as I run across them and documenting the problem.

error 2147023293 :: [0x80070643] :: fatal error during installation

this first one is a requirements issue.  however, you can't see it while you're deploying it.  as you can see below, the installation results in a failure.
image
checking the logs, it doesn't produce anything of further value.
2010\10\04 22:38:49.420 [0x80070643] <E> Error deploying Action Server to OPALIS2:

- _com_error "Fatal error during installation." "" "-2147023293"
 
however, when you check the logs on the action server you're deploying to, it becomes very evident why the installation failed to succeed (as highlighted below).
 === Logging started: 10/4/2010 17:38:47 ===
MSI (s) (C8:C0) [17:38:47:171]: Note: 1: 2262 2: PatchPackage 3: -2147287038 
MSI (s) (C8:C0) [17:38:47:202]: Machine policy value 'DisableRollback' is 0
MSI (s) (C8:C0) [17:38:47:218]: User policy value 'DisableRollback' is 0
MSI (s) (C8:C0) [17:38:47:249]: PROPERTY CHANGE: Adding UILevel property. Its value is '2'.
MSI (s) (C8:C0) [17:38:47:280]: PROPERTY CHANGE: Adding ACTION property. Its value is 'INSTALL'.
MSI (s) (C8:C0) [17:38:47:311]: Doing action: INSTALL
Action start 17:38:47: INSTALL.
MSI (s) (C8:C0) [17:38:47:374]: Running ExecuteSequence
MSI (s) (C8:C0) [17:38:47:405]: Doing action: LaunchConditions
Action start 17:38:47: LaunchConditions.
This product requires Microsoft .Net 2.0 or higher.
MSI (s) (C8:C0) [17:38:47:483]: Product: Opalis Integration Server - Action Server -- This product requires Microsoft .Net 2.0 or higher.
Action ended 17:38:47: LaunchConditions. Return value 3.
Action ended 17:38:47: INSTALL. Return value 3.
=== Logging stopped: 10/4/2010 17:38:47 ===
if you can get away with installing .net framework 3.5, you might as well.  it will most likely be necessary in 6.3.

error 2147221164 :: [0x80040154] :: unable to connect to the remote machine

though this shows up in the console, it's also evident in the OISMC* logs.  here's what you may find:
2010\10\04 20:44:34.619 [0x80040154] <E> Error deploying Action Server to OPALIS2:

- Unable to connect to the remote machine with the OpalisRemotingService
- Cannot connect to the Escorter service on the remote machine
- Cannot instantiate "RemoteEscorter"
- _com_error "Class not registered" "" "-2147221164"
generally in this scenario, it's because of a deployment targeting an unsupported operating system.  usually this occurs because the operating system is x64 which is not supported until 6.3.  this blog post from the opalis team lists the new, supported platforms: http://blogs.technet.com/b/opalis/archive/2010/08/12/what-s-coming-in-the-next-opalis-release.aspx
this applies to deployment of the client console as well.

error [0x80070569] :: user account specified does not have rights

I'm not sure this actually requires explanation.  just make sure the account you're using for the install has the "log on as a service" permission.
2010\10\05 13:43:54.229 [0x80070569] <E> Error deploying Action Server to OPALIS2:

The user account specified for the Action Server does not have the "Log on as a service" user right granted. Please specify a user account with the proper rights or add the right to the account that was specified.
 
image

Opalis: Installation Video Tutorial Series

Charles Joy has made some great video’s showing how to install Opalis. Not only the easiest parts are shown but also the more challenging one, the installation of the Operator Console.
Enjoy. Video tutorial series to be found here.
image

Opalis: QIK Video Tutorial Series

QIK, also known as Opalis Quick Integration Kit is the Opalis equivalent of the SDK. Charles Joy has made a nine series video tutorial about how to use QIK in order to  create QIK projects using the QIK CLI and QIK SDK.
Series to be found here.
image

Oct 18, 2010

Windows 7 and Virtual Server

With Windows 7 now at RTM and in my hands, the time has come to start to migrate over. I got the ISO images I needed last week, and immediately started to get things running. One specific thing I needed is to get Virtual Server running on Win 7. I am teaching a class on Aug 13/14 and need to prepare – the class is a Windows 7 upgrade class for Microsoft Partners.
I thought, given we’d achieved RTM, that it would be cool to have the Labs running under Windows 7 RTM. To do that, I just needed to get Virtual Server running and install the course files on my laptop. Now I know it’s not officially supported, but I wanted to see if I could make it work. If so, I can then run and demo the labs with Win7 as the host.
There were only two problems with that. The first is that the labs that come from Microsoft Learning require Virtual Server. But Virtual Server is not supported under Win 7, and is actively blocked. And even if I did get VS running, MSL assume that you will be using earlier OSs to run the labs – and installing these on Windows 7 is specifically blocked by the MSI installer.


After a bit of Googling using my favourite search engine and perusing the MCT private newsgroups, it appears that there are two solutions. However, both involve some hacking (and are probably NOT supported).  The solutions were either to get the labs working under Virtual PC 7, or install VS into Win7 and get it running. While both are possible, I chose to do the latter since this seemed to provide an easier to use solution (if it worked of course!!!).
Naturally, a third (and preferable!) option would be to wait for Microsoft Learning to come up with a supported solution. But that is not likely to happen any time soon and I have a course to teach now. So down the road I went with two main tasks: first, installing Virtual Server on Windows 7 and then installing the Microsoft Learning labs on Windows 7.
Installing Virtual Server under Windows 7
To install Virtual Server under Windows 7 is straightforward, although it involved registry editing (and is NOT supported). The steps are as follows:
  1. Disable the application compatibility fixes. You first need to disable all the application compatibility fixes that would stop you from installing Virtual Server. In Windows 7, bring up the local Group Policy editor and Computer Configuration\Administrative Templates\Windows Components\Application Compatibility\ and enable all of the “Turn off” entries. As here;image
  2. Then go to the Computer Configuration\Administrative Templates\System\Troubleshooting and Diagnostics\Application Compatibility Diagnostics\ folder and disable all of the entries there. Like here:
    image
  3. Reboot to ensure the settings take effect. You could, I suppose, just do a gpupdate /force, but I prefer to reboot.
  4. Install Virtual Server. Download the binaries from Microsoft .com and install it.
  5. Install VS SP1 – depending on what download you get, you may may need to install SP1. NB: Installing SP1 is more difficult once you have completed this process, so why not do it now?
  6. Change Application File Name. To enable the next step to work properly, you need to rename the Virtual Server application file name, by going to the Virtual Server directory (typically C:\Program Files\Microsoft Virtual Server\ ) and rename Vssrvc.Exe – I used Vssrvc_Win7.exe.
  7. Change the registry settings for this new file name.  Run regedit, then find and replace all occurrences of "vssrvc.exe" to vssrvc_Win7.exe. There are around 5 or 6 entries to fix.
  8. Undo the group policy changes you made at step 1 above. This turns all those application compatibility fixes back on (which is probably what you want!).
  9. Reboot.
Once the reboot is completed, you should have (the renamed) Virtual Server running on your Windows 7 box. If you want to just run VMs, off you go. you can create and use VS just as you did on XP or Server 2003. Hoevere, if you want to install a MSL Lab onto the system, you have just a bit more work (hacking) to do.
Install course files for Lab Launcher into Win7
Once you have Virtual Server running, you need to fix the installation file for the lab you want to install, e.g. 6291.MSI. Normally, you just run this MSI file on your master system (and use Ghost et al to then blast it to the rest of the systems in the classroom). The only problem with this approach is that Microsoft Learning have put in an installation block on Win7. That means when you try to run the installation MSI, it fails with an error message (”the operating system version does not meet the minimum version required”). Turns out this is really easy to fix – but you do need an MSI editor.
There are two MSI editors you can use (and both are free):
  • ORCA – this is a free MSI editor from Microsoft and comes as part of the Windows Installer SDK. It’s a bit of a pain to get as you first have to download and install the SDK, and then install Orca.Msi. You can find copies of orca.msi out on the internet, but downloading it from Microsoft is probably safest even if it is a bit tedious.
  • InstEd - you can also use InstEd, a free tool you can get at http://www.instedit.com/. I like Instead and blogged about it a while ago. It’s still cool!
Once you your MSI editor loaded, you need to remove one line from the Launch Condition table. If you are using Orca, you’ll see something like this:
image
Just delete the first line of this table, then save the MSI (File/Save As) to a separate MSI (just in case). Then exit out of Orca and you can run your newly saved MSI. You should be good to go.
Minor issues
I found that, after playing around a bit, Virtual Server was complaining about access permissions of VHDs on the host. I just gave all users full access to the C: on the host and the problem went away.
An important issue to consider is that this is not supported. Yes, it works and works reasonably well. It also involved editing registry entries, and using a MSI editor. From personal esperience, both can be dangerous. So use this information at your own risk.