Jump to content

Recommended Posts

Posted

Hi Everyone

 

I am currently working with a customer who has 2002 and want to move to co-management as they move to Modern device management. They are currently moving from one AD domain to another (they have a two way trust setup), the new domain is configured with Azure Cloud and Azure AD Connect to sync AD identities to the cloud.

 

The SCCM server sits in the old domain however there are some issues with the current environment and it’s not in a healthy state. Examples include:

 

1. Remote control tools do not work for machines configured in the new AD Domain. work fine in the old domain.

 

2. Task sequence smsts logs not reporting/coping back to MECM server on completion of build.

 

3.Deployment of user virtual apps in SCCM fail in new domain, work fine in old domain.

 

The issue occurring is due to in the past the SCCM server was built from a golden image containing duplicate SIDs, when they only had one domain, everything worked as expected however introducing the new domain, certain functionality of SCCM no longer works on new machines. The login is invalid as the authentication attempt contains a SiD that references multiple machines in the target domain meaning the domain controller cannot return valid credentials. The customer believes that re sysprepping the SCCM server could resolve this issue however the problem is the server will still remain in the old domain and they are looking to move all their environment to the new domain eventually and dispose of the old domain.

 

Before we enable co-management and cloud enable SCCM on 2006 we have asked the client to resolve these issues. My thoughts are to build a new SCCM server in their new domain and perform a backup of configMgr DB and other data and just restore that onto a new server, this means no other windows server specific config like SIDs will move across and it should mean a nice tidy clean environment. My question is what impact could this have with the existing estate. Would the same server name need to be used for clients to connect or is further config required to make it work by restoring ConfigMgr to new server.

 

Is there any good documentation around that assists with moving SCCM to a new server?

 

Many Thanks.

Posted

An ex colleague of mine would advocate for not doing any 'migration', and just build the whole thing new, import nothing. Normally I would push back on this, but, given the previous problem, now would be a good time to start again - as you are already with the Domain.

 

However, that its a customer's system does make this a bit of a harder sell. Perhaps map out the work-hours required? Also ping well crafted tweet @ djammer (Director of Engineering MECM/SCCM) on Twitter, he can probably point you to the resources, and given his position it may carry some weight with you customer (He's already sold the customer SCCM - now he just wants them to have the best experience).

  • Thanks 1
Posted

When we recently migrated our SCCM server onto new hardware, we took the opportunity to build it up again from new so that we didnt have legacy data hanging around - but chose to export the apps / packages / tasksequences / query based device collections that were still relevant from the old environment to the new.

 

This can be done relatively easily just right clicking on the desired object and choosing export from the menu. There are also built in powershell cmdlets for exporting all of these that can be used (we've got weekly sheduled tasks that do this, as one form of DR).

  • Thanks 1
Posted
When we recently migrated our SCCM server onto new hardware, we took the opportunity to build it up again from new so that we didnt have legacy data hanging around - but chose to export the apps / packages / tasksequences / query based device collections that were still relevant from the old environment to the new.

 

This can be done relatively easily just right clicking on the desired object and choosing export from the menu. There are also built in powershell cmdlets for exporting all of these that can be used (we've got weekly sheduled tasks that do this, as one form of DR).

 

Thanks Martin, are the PS cmdlets available on github or somewhere or were these custom developed by yourselves internally?

Posted (edited)

The PS cmdlets are built in and get installed when you install the sccm console on a machine - so we just run them from our managment VM.

 

The ones you want to concentrate on are Export-CMApplication and Export-CMPackage There are also corresponding cmdlets for task sequences, baseline configs, device collections (possibly more, but those are the ones we concentrated on).

 

As an example, here is how we use them in our scheduled task:

Export_All_Apps.ps1

Param(    

   [parameter(
   Position = 0, 
   Mandatory=$true )
   ] 
   [Alias("SMS")]
   [ValidateScript({
       $ping = New-Object System.Net.NetworkInformation.Ping
       $ping.Send("$_", 5000)})]
   [ValidateNotNullOrEmpty()]
   [string]$SMSProvider="",

   [parameter(
   Position = 1,
   Mandatory = $true )
   ]
   [string]$ExportFolder
)

Function Get-SiteCode
{
   $wqlQuery = “SELECT * FROM SMS_ProviderLocation”
   $a = Get-WmiObject -Query $wqlQuery -Namespace “root\sms” -ComputerName $SMSProvider
   $a | ForEach-Object {
       if($_.ProviderForLocalSite)
           {
               $script:SiteCode = $_.SiteCode
           }
   }
return $SiteCode
}

$SiteCode = Get-SiteCode

#Import the CM12 Powershell cmdlets
if (-not (Test-Path -Path $SiteCode))
   {
       Write-Verbose "CM12 module has not been imported yet, will import it now."
       Import-Module ($env:SMS_ADMIN_UI_PATH.Substring(0,$env:SMS_ADMIN_UI_PATH.Length – 5) + '\ConfigurationManager.psd1') | Out-Null
   }
#CM12 cmdlets need to be run from the CM12 drive
Set-Location "$($SiteCode):" | Out-Null
if (-not (Get-PSDrive -Name $SiteCode))
   {
       Write-Error "There was a problem loading the Configuration Manager powershell module and accessing the site's PSDrive."
       exit 1
   }

$Apps = Get-CMApplication 
foreach ($App in $Apps)
   {
       $AppFileName = $App.LocalizedDisplayName -replace ("/","_")
       #Export-CMApplication -OmitContent -Path "$(Join-Path $ExportFolder $($App.LocalizedDisplayName)).zip" -ID $($App.CI_ID) -Force
       Export-CMApplication -OmitContent -Path "$(Join-Path $ExportFolder $($AppFileName)).zip" -ID $($App.CI_ID) -Force
   }

Export_All_Packages.ps1

Param(    

   [parameter(
   Position = 0, 
   Mandatory=$true )
   ] 
   [Alias("SMS")]
   [ValidateScript({
       $ping = New-Object System.Net.NetworkInformation.Ping
       $ping.Send("$_", 5000)})]
   [ValidateNotNullOrEmpty()]
   [string]$SMSProvider="",

   [parameter(
   Position = 1,
   Mandatory = $true )
   ]
   [string]$ExportFolder
)

Function Get-SiteCode
{
   $wqlQuery = “SELECT * FROM SMS_ProviderLocation”
   $a = Get-WmiObject -Query $wqlQuery -Namespace “root\sms” -ComputerName $SMSProvider
   $a | ForEach-Object {
       if($_.ProviderForLocalSite)
           {
               $script:SiteCode = $_.SiteCode
           }
   }
return $SiteCode
}

$SiteCode = Get-SiteCode

#Import the CM12 Powershell cmdlets
if (-not (Test-Path -Path $SiteCode))
   {
       Write-Verbose "CM12 module has not been imported yet, will import it now."
       Import-Module ($env:SMS_ADMIN_UI_PATH.Substring(0,$env:SMS_ADMIN_UI_PATH.Length – 5) + '\ConfigurationManager.psd1') | Out-Null
   }
#CM12 cmdlets need to be run from the CM12 drive
Set-Location "$($SiteCode):" | Out-Null
if (-not (Get-PSDrive -Name $SiteCode))
   {
       Write-Error "There was a problem loading the Configuration Manager powershell module and accessing the site's PSDrive."
       exit 1
   }

$Packages = Get-CMPackage -fast
foreach ($Package in $Packages)
   {
       write-host working on $Package.Name
       Export-CMPackage -WithContent $FALSE -ExportFilePath "$(Join-Path $ExportFolder $($Package.Name)).zip" -ID $($Package.PackageID)
   }

Apps_Backup.ps1

$DT = Get-Date -Format yyyy_MM_dd
Start-Transcript -Path E:\Scripts\Applications_Backup\$DT.txt
&\Export_All_Apps.ps1 -SMSProvider FQDN.Of.SCCM.Server -ExportFolder  -Verbose
&\Export_All_Packages.ps1 -SMSProvider FQDN.Of.SCCM.Server -ExportFolder  -Verbose

 

this will generate a folder full of zip files, that can be imported to the new environment either in a scripted en mass fashion, or individually.

Edited by MartinByard
  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...