Thanks to Kent Agerlund at Truesec.com.
Installing a secondary site
Installing a secondary site might seem like a straight forward process; and with a little planning that is not far from the truth. My latest remote site was on a server located on the other side of the world. I had a few challenges:
- Very poor bandwidth
- Large number of packages and images (approx. 150 GB)
- SQL server is configured using a non-standard port
To solve the challenge here is what I had to do.
- Prior to installing I copied all pck files from the central site server to a USB drive and shipped the drive with a colleague to “far far away”.
- Install Windows 2008 R2 server with the latest patches.
- Install and configure IIS according to documentation.
- Install and configure WDS according to documentation.
- Install the Configuration Manager 2007 Toolkit 2 (Yes, you will need Trace32.exe to read log files).
- Install SQL 2008 R2 Client tools
- Configure a x86 alias for Configuration Manager to use my custom port SQL port
- Configure a x64 alias for WDS to use my custom SQL port
- You can use Netstat –a to verify the port being used to establish the connection
- More info on this can be found in this post.
- Installed and configured the secondary site server.
- Created a small package on my central site server and distributed in to my new secondary site server.
- Copied all compressed PCK packages to d:\SMSPCK on the local secondary site server
- Copied PreloadPkgOnSite.exe from the Configuration Manager v2 toolkit to D:\SMSPKG.
- The tool will work right out of the box with most packages but, for some packages (where the package source id and compressed package version id is not identical) the tool will write the wrong package id to the database and package replication will fail. For that reason you must identify the packages with unmatched id’s and run preloadpkgonsite.exe /updatepackageid [id number].
- To save some time you can run this PowerShell script (written by Greg Ramsey). The script will check the database for versions and write the correct syntax to a bat file. Before running the script you must replace PROVIDER and Sitecode with the names of your Provider server and sitecode.
$pkgs = get-wmiobject sms_package -computer PROVIDER -namespace root\sms\site_Sitecode
$pkgs | foreach {
if (test-path @("D:\smspkg\" + $_.PackageID + ".pck"))
{
$output += @("PreloadPkgOnSite.exe " + $_.PackageID + " /UpdateStoredPkgVersion " + $_.StoredPkgVersion)
}
}
$output | out-file -filepath "D:\SCCM Install\preloadpck.bat" -encoding ascii
- Run the preloadpck.bat to start the package replication
- After the replication is finished you will need to add a distribution point to the new packages. This can easily be done using the Copy packages wizard in the console or by using the DP utility tool from Cory Becht. The cool part about this tool is that it can also be used to remove packages from a DP.
When packages are added to the DP the compressed pck files will be decompressed locally at the secondary site server using only very little bandwidth. You can monitor this process by reading the distrmgr.log file on the secondary site server.
