Categories
ConfigMgr

ConfigMgr : KB2840628 Workaround and Taking Control of a CONFIGMGRSEC Database

Came up against the known ConfigMgr issues associated with KB2840628 today. Initially I noticed that one of the Distribution Point Groups I have was showing content replication for a large number of packages as ‘In Progress’ – these dated back over the last few days: 

DPstats

So I then noticed that the Database Replication for the Secondary Site where these Distribution Points were had failed. Digging a little deeper I had a strange .Net error in rcmctrl.log on the Secondary Site server:

{code lang:text showtitle:false lines:false hidden:false}Asynchronous command finished with return message: [A .NET Framework error occurred during execution of user-defined routine or aggregate “spDRSActivation”: ~~System.TypeInitializationException: The type initializer for ‘System.Data.SqlClient.SqlConnection’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘System.Data.SqlClient.SqlConnectionFactory’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘System.Data.SqlClient.SqlPerformanceCounters’ threw an exception. —> System.MethodAccessException: Attempt by method ‘System.Configuration.TypeUtil.CreateInstanceRestricted(System.Type, System.Type)’ to access method ‘System.Diagnostics.SwitchElementsCollection..ctor()’ failed. —> System.Security.SecurityException: Request failed.~~System.Security.SecurityException: ~~ at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)~~ at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)~~ at System.Security.PermissionListSet.CheckSetDemandWithModification(PermissionSet pset, PermissionSet& alteredDemandSet, RuntimeMethodHandleInternal rmh)~~ at System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandleInternal rmh)~~ at System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)~~ at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant)~~System.TypeInitializationException: ~~ at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()~~ at Microsoft.ConfigurationManager.DataReplicationService.DatabaseOperation.ExecuteNonQuery(String commandText)~~ at Microsoft.ConfigurationManager.DataReplicationService.MessageHandl…].{/code}

More info available on this known issue here:
http://blogs.technet.com/b/configmgrteam/archive/2013/07/17/issues-reported-with-ms13-052-kb2840628-and-configmgr.aspx

The supplied workaround required using SQL Management Studio to perform the following:

SQL Server -> Databases -> (Site Database) -> Programmability -> Assemblies -> MessageHandlerService ->Right-click and select Properties and highlight -> General -> Expand the “Permissions Set” drop-down -> Select Unrestricted.
When the change is made, replication between sites should automatically recover within 5-10 minutes.

Also, the same is required for the SMSSQLCLR assembly Permission; SQL Server -> Databases -> (Site Database) -> Programmability -> Assemblies -> SMSSQLCLR

Of course, when ConfigMgr deploys a Secondary Site SQL instance there is a limited set of users defined that have SYSADMIN access to the instance. To perform this changes I needed SYSADMIN access.

Using the SysInternals tools, specifically PSExec I was able to grant myself these permissions:

{code lang:text showtitle:false lines:false hidden:false}:: Launch cmd.exe via PSexec in SYSTEM Context
psexec -s cmd

:: Create new login and add to SYSADMIN role
osql -E -S SRV1\INSTANCE -Q “sp_grantlogin ‘DOMAIN\user'”
osql -E -S SRV1\INSTANCE -Q “sp_addsrvrolemember @loginame=’DOMAIN\user’, @rolename=’sysadmin'”
{/code}

I could then make the required changes – once completed the content that was stuck ‘In Progress’ slowly transitioned to a ‘Success’ status.

 

Categories
ConfigMgr

ConfigMgr : Deployment Update Failed 80091007

Strange one this… I recently released a new version of a product in ConfigMgr, configured supersedence and waited for the defined uninstall/update to occur – only it didn’t. The software appeared to download on the client as expected (both old and new version) and then without any update in AppEnforce.log the deployment failed with an 80091007 error code.

On further investigation CAS.log contained the following:

{code lang:ini showtitle:false lines:false hidden:false}Download completed for content Content_1a0a6203-e945-4228-911c-3e3f7b6082aa.1 under context System ContentAccess 21/07/2013 16:48:36 9600 (0x2580)
Computed hash: 5AEBBE1E909AF384387E804ABCE3C8C71BBA007B433731766C0734EE44A28938 ContentAccess 21/07/2013 16:48:36 9600 (0x2580)
Failed to do hash verification with preference : 4. Try to verify at next hash algorithm ContentAccess 21/07/2013 16:48:36 9600 (0x2580)
Download failed for content Content_1a0a6203-e945-4228-911c-3e3f7b6082aa.1 under context System, error 0x80091007 ContentAccess 21/07/2013 16:48:36 9600 (0x2580){/code}

Content hash verification had failed.. strange as the MSI had been tested and was working. I simply updated the deployment content , waited for this to distribute and tested again without issue…!

Categories
ConfigMgr

ConfigMgr 2012 ; CcmExec.exe Exception code: 0xeeeefffe

I’ve had this crop up randomly on a number of machines now – software/update deployment stops working.  On investigation the SMS Host Agent service is not running. When restarted the service wont stay started – the system event log on the client is populated with the following errors:

{code lang:xml showtitle:false lines:false hidden:false}Log Name: Application
Source: Application Error
Date: 14/02/2013 09:14:34
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: <Client FQDN>
Description:
Faulting application name: CcmExec.exe, version: 5.0.7804.1000, time stamp: 0x50add095
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16850, time stamp: 0x4e21132b
Exception code: 0xeeeefffe
Fault offset: 0x00009673
Faulting process id: 0xd74
Faulting application start time: 0x01ce0a939470cbdb
Faulting application path: C:\Windows\CCM\CcmExec.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: f1e3ad5b-7686-11e2-abf7-5c260a383293{/code}

Thanks to linkess from the TechNet forums I revised all of my Boundary Groups, creating a set of Boundary Groups that assign servers for content only, and a set of Boundary Groups for Site Code assignment (no servers listed in these).

I also ensured that only servers from the correct site were listed under each content group.

Categories
ConfigMgr

ConfigMgr 2012 ; Automatic Deployment Rule 0x80072efd

During deployment/configuration I ran into an issue where the Automatic Deployment Rule started failing. Tracing traffic via WireShark showed that a proxy server had been picked up (probably from a WPAD DNS entry) and as a result the ADR was failing to download.

Ruleengine.log showed: ‘Failed to download the update from the internet. Error = 12029’

Patchdownloader.log (careful as this changes location if the client is installed): ERROR: DownloadContentFiles() failed with hr=0x80072efd

To resolve I executed the following commands on the Primary Site Server (if you have a CAS then ensure you execute the command on the CAS server):

  • bitsadmin /Util /SetIEProxy LOCALSYSTEM NO_PROXY
  • bitsadmin /Util /SetIEProxy NETWORKSERVICE NO_PROXY       

 

By default these will be set to AUTODETECT – I can only guess that the server was picking up a proxy server from another domain in the environment.

Categories
ConfigMgr

ConfigMgr 2012 : App-V Management Server Co-Existence

One question I had for the ConfigMgr rollout was around how the migration from App-V Management Server to ConfigMgr was going to work. Specifically my questions were:

  1. Could the environments co-exist?
  2. Do we have to uninstall/reinstall the App-V Client with different settings?
  3. Will we lose the App-V client cache? With many remote users losing the cache was potentially a nightmare.
  4. What happens if I re-publish an App-V application via ConfigMgr that was originally published via App-V Management Server will it re-download?

After testing I have answered my questions.

Categories
ConfigMgr

ConfigMgr 2012 : Collection by Domain Name

In a multi-domain environment you may wish to create collection (s) that are based on domain name; use the following query to do just that:

{code lang:sql showtitle:false lines:false hidden:false}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.ResourceDomainORWorkgroup = “NETBIOS NAME”{/code}

Categories
ConfigMgr

APPV : Move SQL Database – Collation Issues

I’ve recently had to move an App-V Management Server’s SQL database to a new environment. Following the guide here I encountered an issue once completed – all clients could not refresh the publishing server or stream applications! The error I received is illustrated below:

App-V Error

Error code: 4513CDC-160650A-200001F4

After enabling verbose logging on the AppV Management Server I identified the following errors:

[2012-07-16 12:39:24.082] <SERVER NAME> 3920 924 SWExecDcRefreshProc – “Default Provider Policy” Administrator – 5 65535 “Failed to move to second result set on statement.”
[2012-07-16 12:39:24.082] <SERVER NAME> 3920 924 SWConstructDcRefreshXml – “Default Provider Policy” Administrator – 5 65535 “Failed to create XML.”
[2012-07-16 12:39:24.082] <SERVER NAME> 3920 924 RTSPHandlerEx::HandleGetAppList – “Default Provider Policy” Administrator – 5 65535 “Failed to construct <APPLIST>. Status[21887760]”
[2012-07-16 12:39:24.082] <SERVER NAME> 3920 924 SW_RTSPHandler::SendResponse – “Default Provider Policy” Administrator – 5 65535 “Response: [RTSP/1.0 500 Internal Server Error]

The client was reporting the following errors:

[07/12/2012 17:48:04:416 MIME ERR] {tid=244:usr=<USER ID>}
Failure on Desktop Configuration Server request to URL {rtsp:<SERVER FQDN>:554/} with header {Host: <SERVER FQDN>
Content-Type: text/xml
} (rc 1690650A-200001F4).

Seeing as the above wasn’t all that helpful I took a look at what was going on at a database level using SQL Profiler; it became apparent that there was a collation mismatch issue. The previous instance had been set to SQL_Latin1_General_CP1_CI_AS, whereas the new instance was set as the default Latin1_General_CI_AS.

After reviewing the stored procedure that was failing in the trace – sp_SFTgetPorterDCRefreshXML – it was clear that it was using a TEMP TABLE to perform comparisons. Temp tables sit in a system database and therefore use the system collation, not the database collation, unless you modify the declaration of your table to ensure that any varchar, nvarchar, text, ntext columns use the dataabse collation, not the system collation.

I used the following SQL to identify all stored procedures that created temporary tables:

{code lang:sql showtitle:false lines:false hidden:false}SELECT DISTINCT B.Name
FROM syscomments A INNER JOIN sysobjects B
ON A.id = B.id
WHERE A.text like ‘%CREATE TABLE #%’
ORDER BY{/code}

This generated a list of 16 Stored Procedures, although it turned out that I only needed to change 4 – Microsoft had correctly defined all of the other temp tables to use the database collation (consistency is overrated right?):

  1. sp_SFTaddpackageversion
  2. sp_SFTgetAlewifeDCRefreshXML
  3. sp_SFTgetPorterDCRefreshXML
  4. sp_SFTgetselectedapps

To ‘fix’ each stored procedure look for ‘CREATE TABLE #’ and modify as outlined below. Note you do not need to change numeric or date/time declarations, just text based ones:

Before:

{code lang:sql showtitle:false lines:false hidden:false}CREATE TABLE #temp_appdailyUserCount (
app_id int NOT NULL,
usage_date datetime NOT NULL,
Username nvarchar(256) NOT NULL ) {/code}

After:

{code lang:sql showtitle:false lines:false hidden:false}CREATE TABLE #temp_appdailyUserCount (
app_id int NOT NULL,
usage_date datetime NOT NULL,
Username nvarchar(256) COLLATE database_default NOT NULL )
{/code}

Categories
ConfigMgr

ConfigMgr : OSD Install Updates Download Hangs

I knew it had been too long since my last issue with ConfigMgr 2012! I’ve just redeployed the Configuration Manager 2012 environment my previous articles were based on only to encounter a new problem!

The issue is that now during Operating System Deployment during the ‘Install Updates’ step, downloading the updates appears to hang randomly as illustrated below.

BuildCapture UpdatesHang-ReSize

          Downloading xx of xx Updates (xx% complete)…

The solution was fairly simple. After reviewing the DataTransferService.log file under C:\Windows\CCM\Logs I found the following errors:

<![LOG[Error sending DAV request. HTTP code 600, status ”]LOG]!><time=”08:37:54.017-120″ date=”07-16-2012″ component=”DataTransferService” context=”” type=”3″ thread=”2572″ file=”util.cpp:629″>

<![LOG[Error retrieving manifest (0x800704cf).  Will attempt retry 6 in 960 seconds.]LOG]!><time=”08:37:54.017-120″ date=”07-16-2012″ component=”DataTransferService” context=”” type=”2″ thread=”2572″ file=”dtsjob.cpp:1161″>

<![LOG[Failed to send request to /NOCERT_SMS_DP_SMSPKG$/4e90bf14-4e96-47e1-b32e-8a8e9fcc28df at host <DP FQDN>, error 0x2efe]LOG]!><time=”08:37:54.345-120″ date=”07-16-2012″ component=”DataTransferService” context=”” type=”2″ thread=”728″ file=”ccmhttpget.cpp:1801″>

<![LOG[[CCMHTTP] ERROR: URL=https://<MP FQDN>:443/NOCERT_SMS_DP_SMSPKG$/4e90bf14-4e96-47e1-b32e-8a8e9fcc28df, Port=443, Options=480, Code=12030, Text=ERROR_WINHTTP_CONNECTION_ERROR]LOG]!><time=”08:37:54.345-120″ date=”07-16-2012″ component=”DataTransferService” context=”” type=”1″ thread=”728″ file=”ccmhttperror.cpp:291″>

So I copied the URL highlighted above into a browser window and got ‘page cannot be dispalyed’…! In fact it turned out that no HTTPS pages could be displayed, despite the HTTPS binding being configured in IIS. I removed the HTTPS binding on the Default Website and recreated it… problem solved.

Categories
ConfigMgr

ConfigMgr 2012 : Application Catalog Login Popup Cross-Domain

So, you can probably see from the spat of recent articles on here that I’m working on a Configuration Manager deployment..! The deployment spans multiple domains, with the Application Catalog role residing in another domain to some user accounts – all within the same forest mind. This will cause a login prompt if a user tries to open the Application Catalog Web Site, even if the site is in the Trusted Sites zone.

First things first you need to modify the ACL of the folder containing website itself on the Application Catalog server – <Install Path>\SMS_CCM\CMApplicationCatalog. Add each domain’s Domain Users group with Read and Execute, Read and List Folder Contents.

Next you need to add the site URL’s to the Local Intranet zone in order for credentials to be sent. Unfortunately this cannot be achieved using the Configuration Manager Device Policies, you’ll have to either use a Group Policy or a script.

Scripted Method (preferred)

The following VBscript will work, change the FQDN of your Internet Management Point and then distribute as a package in ConfigMgr 2012. Create a program within your package that has the following command line setup: cscript.exe /nologo <script file>.vbs

Note that this will not work on machines that have Internet Explorer Enhanced Security Configuration (IE ESC) enabled.

{code lang:javascript showtitle:false lines:false hidden:false}On Error Resume Next
Const HKEY_CURRENT_USER = &H80000001

strComputer = “.”

Set objReg = GetObject(“winmgmts:{impersonationLevel=impersonate}\\” & strComputer & “\root\default:StdRegProv”)
strKeyPath = “Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\<internet MP FQDN>”

objReg.CreateKey HKEY_CURRENT_USER,strKeyPath

strValueName = “https”
dwValue = 1

objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
{/code} 

Group Policy Method

Create a new/edit an existing GPO in each domain with the settings defined below.

Browse to: Administrative Templates > Windows Components > Internet Explorer > Internet Control Panel > Security Page

Then look for the Site to Zone Assignment List, enable and add the following (the value ‘1’ is used to define the Local Intranet zone)

    • Value Name: https://<intranet fqdn>/  Value: 1
    • Value Name: https:/</internet> fqdn>/    Value: 1
    • Value Name: http://<intranet fqdn>/  Value: 1
    • Value Name: http:/</internet> fqdn>/    Value: 1

Don’t use the built-in Configuration Manager Device Policy method to add this to Trusted Sites as this will not pass NTLM credentials.

There is a downside to this, all Zones becomes ‘Managed’ – i.e. users will be unable to modify the membership of any zones.

Categories
ConfigMgr

ConfigMgr 2012 : Creating a Multi-Regional / Multi-Lingual Windows Image

You can use this language pack deployment method to integrate many languages at once into a Windows Image during Build and Capture, or even Image Deployment, the primary display and input language are set by the Unattend file.