Wednesday, 18 January 2017

WMI Query to List Down two Application Installed Machines - SCCM 2012


Query to list all the systems with Program A and Program B, use the following query.
Replace Program A and Program B with your application add remove programs display name

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_R_System.ResourceId from  SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like 'Programe A') and SMS_R_System.ResourceId in (select  SMS_R_System.ResourceId from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like 'Programe B')

Thursday, 1 December 2016

Unable to access DP Source - HTTP code 503 service unavailable


Sometimes you find clients are failed to download software updates , application and you will be seeing error massage HTTP code 503 service unavailable in few client logs.



First you have to check the boundary and boundary group are correctly configured
Then check if you see any error in IIS or check the application pool is running, If its stopped start again.
If the IIS Application Pool stops frequently,  check for any error in event viewer


If you find the about error, it could be related with permission issue
Check  HKLM\Software\Microsoft\SMS permission, if the permission are not configured for users,
Create it as mention below.


Friday, 11 November 2016

WSUS Cleanup Using SQL Script

Whenever we do a cleanup on WSUS we always get the below error.

Every update on WSUS (even if they are unapproved) get their metadata sent to clients unless the updates are marked as expired

WSUS does not clean unneeded (obsolete? superseded? unapproved?) updates itself. we had been running it as a "fire and forget" server: allow it to auto approve security updates and then leaving it alone. This fills the database with a bunch of updates that gets sent out

WSUS has a Cleanup Wizard which is supposed to expire obsolete and unneeded updates. We tried running this, but it would get stuck and hang forever


There is lots of advice about how to fix this problem: defragging hard drives, running the Cleanup Wizard multiple times, running weird PowerShell scripts that launch the Wizard via the command line. Most of the time noting will work 


Finally we found the below script which will help to do the cleanup through SQL

  1. ·         We can’t access WSUS database through remote SQL Management Studio, so we have to install SQL Management Studio locally.
  2. ·         To connect SUSDB - \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query For Server 2012 \\.\pipe\MICROSOFT##WID\tsql\query.
  3. ·         Make a New Query

Run the below query to check the status
exec spGetObsoleteUpdatesToCleanup

Again execute the below query to clean up the unapproved, superseded and obsolete updates.

DECLARE @var1 INT
                                DECLARE @msg nvarchar(100)
                                 CREATE TABLE #results (Col1 INT)
                                INSERT INTO #results(Col1) EXEC spGetObsoleteUpdatesToCleanup
                                 DECLARE WC Cursor
                                FOR
                                SELECT Col1 FROM #results
                                OPEN WC
                                FETCH NEXT FROM WC
                                INTO @var1
                                WHILE (@@FETCH_STATUS > -1)
                                BEGIN SET @msg = 'Deleting ' + CONVERT(varchar(10), @var1)
                                RAISERROR(@msg,0,1) WITH NOWAIT EXEC spDeleteUpdate @localUpdateID=@var1
                                FETCH NEXT FROM WC INTO @var1 END
                                CLOSE WC
                                DEALLOCATE WC
DROP TABLE #results

Now check if you see any update using this query - exec spGetObsoleteUpdatesToCleanup

Finally, run the WSUS cleanup wizard now, you will not get any errors now.

Thursday, 3 November 2016

Task Sequence - Restart Option - Error (0x00000032)


In SCCM image deployment if you get the below error during software/application installation, it could be a problem with restart step in task sequence




To confirm this you have to check the deployment log and you will be getting the below error after the restart step,

The operating system reported error 50: The request is not supported

If you check the restart properties in the task sequence the important thing to note here is that the Reboot must be set to restart "The currently installed default operating system" otherwise it will try and run the TS boot image again which obviously won't really like trying to install drivers/software/applications. In short, be sure any reboot which forms part of the Task Sequence has the below option selected,


SCCM Console Object Edit Error (Cannot edit the object which is used by...)



Sometimes when you try to edit any objects in 2012 Console, you probably get the below error, 

his because the ConfigMgr console was crashing while editing the object.




We have to run the following query in SQL to free the objects again

 select * from SEDO_LockState where LockStateID <> 0
(where SEDO stands for Serialized Editing of Data Objects)

Collect the Lock ID from the above query result and delete it with the below query,

DELETE from SEDO_LockState where LockID = ‘<LockID of the record identified in the previous query>’

Once the record is removed, We should be able to modify the object again. Hope it helps!

Friday, 16 September 2016

SCCM Secondary Site SQL Replication Issue (DRS Issue)


When you see the SQL replication has been failed and try to run replication link analyzer and you get there is an DRS issue with database, try these steps,

Below command will help you to view all SQL replication status
EXEC spDiagDRS – Running this command in SQL Management Studio will show all filed of SQL Replication

If you see the the replication group is disable ot inactive follow the below steps,


  • Run this command to remove To service entry from SSB_Dialogpool “delete from SSB_DialogPool where ToService like '%PRIMARYSITECODE'
  • On the Secondary Site create the below two files under C:\Program Files\Microsoft Configuration Manager\inboxes\rcm.box

  1. Secondary_Site_Replication_Configuration.pub
  2. Secondary Site Data.pub


  • Now run EXEC spDiagDRS command again and check if all replications are active


Wednesday, 7 September 2016

Distribution Point Installation failed to install Error 0x800706BA

When you install SCCM distribution point you may get this error on distmgr.log DPConnection::ConnectWMI() – Failed to connect to servernameError 0x800706BA

This means that SCCM server is unable to connect to the WMI namespace on the target machine which is why the installation of distribution point is failing. You would also see an error which reads Failed to install DP files on the remote DP Error code=1722

Fix

Copy the smsdpprov.mof file into Distribution Point installation drive, you can find the smsdpprov.mof file under <drive:>\Program Files\Microsoft Configuration Manager\bin\X64 in your primary site server

Run the command prompt as administrator and execute the following command
mofcomp.exe smsdpprov.mof














If you still getting the same error run the below command,

netsh firewall set service remoteadmin enable

This command will allow remote user to execute / allow access the local firewall policy

🔍SCCM (MECM) RAS Assessment

  SCCM (MECM) RAS Assessment – Comprehensive Checklist 1️⃣ Site Infrastructure & Core Health ✔ Site Server Component Status Site c...