Showing posts with label SCCM. Show all posts
Showing posts with label SCCM. Show all posts

Thursday, January 29, 2015

Failed to Add Update Source for WUAgent of type 2 (Error = 0x80004005)

I ran across an issue this morning where Windows Updates were not getting deployed to a client. I checked the reports, and found that the client was not reporting any missing updates.
I knew this client was not working, as the compliance state was listed as unknown on the SCCM reports. The first thing I check was policy. I was unable to get to the policy editor and that seems tol point to something in this direction.
The execmgr.log was also clean.
Next, I checked the WUAHandler.log and true enough the error is in here

<![LOG[Failed to Add Update Source for WUAgent of type (2) and id ({CEF9E8E9-C241-47CC-B86A-A7380539BF47}). Error = 0x80004005

To resolve issue, delete the C:\Windows\System32\GroupPolicy folder and restart the SCCM Agent.
After which you should see entries similar to the below

<![LOG[Enabling WUA Managed server policy to use server: https://SINWSUS01.intlsos.com:8531]LOG]!><time="11:51:44.524+000" date="01-29-2015" component="WUAHandler" context="" type="1" thread="4228" file="sourcemanager.cpp:1054">
<![LOG[Waiting for 2 mins for Group Policy to notify of WUA policy change...]LOG]!><time="11:51:44.540+000" date="01-29-2015" component="WUAHandler" context="" type="1" thread="4228" file="sourcemanager.cpp:1060">
<![LOG[Waiting for 30 secs for policy to take effect on WU Agent.]LOG]!><time="11:52:05.792+000" date="01-29-2015" component="WUAHandler" context="" type="1" thread="4228" file="sourcemanager.cpp:1124">
<![LOG[Added Update Source ({CEF9E8E9-C241-47CC-B86A-A7380539BF47}) of content type: 2]LOG]!><time="11:52:35.827+000" date="01-29-2015" component="WUAHandler" context="" type="1" thread="4228" file="sourcemanager.cpp:1381">
<![LOG[Async searching of updates using WUAgent started.]LOG]!><time="11:52:35.936+000" date="01-29-2015" component="WUAHandler" context="" type="1" thread="4228" file="cwuahandler.cpp:587">

Wednesday, September 24, 2014

SCCM Client breaks after Site Signing Certificate Renewal


The ConfigMgr sites in where I work is running in Native Mode and this means that there will be certificates required for this. Recently, the site signing certificate for one of my sites is expiring and hence renewal is required. The renewal went smooth for the Document Signing. However, after the new site signing certificate was issued  and assigned to the site, all clients stopped getting policies.

We got this error on the clients's PolicyAgent.log:




Everything looked fine, all certificates got issued, all clients trusted the new certificate, but still the ConfigMgr agent would not work. However, uninstalling and re-installing the client solved the problem, but I can't possibly be doing this for over 10000 clients?

Technically speaking, renewing/replacing the site signing certificate issued from the same Certificate Authority should not cause this issue but... Usually the new certificate will be automatically downloaded when renewing the certificate
But for my case, this unfortunately did not happen.
I had to remove the old site signing certificate on the ConfigMgr client agents. This is stored in the registry, and can be worked out with a simple Group Policy Preferences fix.

For me, I used the vbs below with a combination of psexec to do the same

const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\CCM\Security"
strValueName = "AllowedRootCAHashCode"
strValue = ""

objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue

Basically what you need to do is to remove the client copy of the site server signing certificate if you change the root certification, locate the value named AllowedRootCAHashCode (type REG_SZ) and delete the associated value data that appears as a string of hexadecimal numbers.”
For x86-systems: HKLM\SOFTWARE\Microsoft\CCM\Security
For x64-systems: HKLM\SOFTWARE\Wow6432Node\Microsoft\CCM\Security

After this is done, you should restart the SMS Agent service and you should continue to monitor the PolicyAgent.log for the cleanup of machine policy and after which all should work. 

Friday, May 23, 2014

Server in which SCCM Collection?

Most servers in SCCM would be a member in a couple collections and it would be pretty challenging to track which collections it is a member of.
The following SQL query will enable you just to do that 

select v_FullCollectionMembership.CollectionID, v_Collection.Name, v_R_System.Name0 from v_FullCollectionMembership 
JOIN v_R_System on v_FullCollectionMembership.ResourceID = v_R_System.ResourceID 
JOIN v_Collection on v_FullCollectionMembership.CollectionID = v_Collection.CollectionID 
Where v_R_System.Name0='Servername'

** Replace Servername with the servername you are checking against.

Wednesday, May 21, 2014

Cleaning up expired updates in SCCM


In SCCM, it is essential to house keep the update lists to remove expired updates in order to ensure that the compliance is reported correctly.

Of course you can manually go through all the update lists and deployment packages that you have created to remove those but why not use some tools to help you achieve that instead?

The below post is a VBS written by someone in the community which is very useful for this.

http://blogs.msdn.com/b/minfangl/archive/2012/10/16/script-to-clean-expired-updates-from-update-lists-packages-and-deployments.aspx

I have made minor amendments to the vbs which you can download from here
To use simply download the file and place it in a folder on the SCCM Server.
Open up command prompt and run the command below in the folder where you have placed the vbs

cscript ExpireClear.vbs [-d] -l|-r:<remoteserver> -u:<Username> -p:<password>

Switches defnitions
-d enable debug logging
-l connect to local machine
-r connect to remote machine

If -r is used, the user's credentials has to be provided.

When the vbs completes, you will be prompted to run a full synchronization whihc can be achieve using the below

1) In the Configuration Manager console at the highest site in the hierarchy with an active software update point, navigate to System Center Configuration Manager / Site Database / Computer Management / Software Updates / Update Repository.

2) Right-click Update Repository, and then click Run Synchronization. Software updates synchronization is initiated as soon as possible.
When synchronization is complete, a request is sent to child sites to initiate synchronization.


Thursday, May 15, 2014

Retrieving Local Administrators on Machines by SCCM


IT in some Organizations may grant users with local admin rights
As time goes by when there is a time when we need to know who has local admin rights on their machines , this would be a potential challenge if the process is not defined clearly.

SCCM can be utilized to get this information using the steps below

1) The DCM Configuration Item.
- Create a new, General Configuration Item and name it whateveryou wish, but you'll need to use that name later in a report.

For this case, the name is "Local Group Members into WMI", click Next
- There are no Objects, click Next
- Under Settings, Select New, Script.
- Display Name doesn't matter, I'll call it "WMIFramework For LocalGroupMembers"
- Description can be anything, sych as "Custom WMI Namespace of root\cimv2\cm_localgroupmembers"
- copy and paste the vbs as below

======================================================================
on error resume next
'Steps
'enumerate from win32_group where localaccount=1
'Read in the members of each local group returned
'Add the returned information to a custom WMI namespace
'sms-def.mof to pull that back.
Set fso = CreateObject("Scripting.FileSystemObject") 
Set nwo = CreateObject("Wscript.Network") 
Set sho = CreateObject("Wscript.Shell") 
TempFolder = sho.ExpandEnvironmentStrings("%temp%")
strWindir = sho.ExpandEnvironmentStrings("%windir%")
strComputer = nwo.ComputerName
Dim wbemCimtypeSint16 
Dim wbemCimtypeSint32 
Dim wbemCimtypeReal32 
Dim wbemCimtypeReal64 
Dim wbemCimtypeString 
Dim wbemCimtypeBoolean 
Dim wbemCimtypeObject 
Dim wbemCimtypeSint8 
Dim wbemCimtypeUint8 
Dim wbemCimtypeUint16 
Dim wbemCimtypeUint32 
Dim wbemCimtypeSint64 
Dim wbemCimtypeUint64 
Dim wbemCimtypeDateTime 
Dim wbemCimtypeReference 
Dim wbemCimtypeChar16 

wbemCimtypeSint16 = 2 
wbemCimtypeSint32 = 3 
wbemCimtypeReal32 = 4 
wbemCimtypeReal64 = 5 
wbemCimtypeString = 8 
wbemCimtypeBoolean = 11 
wbemCimtypeObject = 13 
wbemCimtypeSint8 = 16 
wbemCimtypeUint8 = 17 
wbemCimtypeUint16 = 18 
wbemCimtypeUint32 = 19 
wbemCimtypeSint64 = 20 
wbemCimtypeUint64 = 21 
wbemCimtypeDateTime = 101 
wbemCimtypeReference = 102 
wbemCimtypeChar16 = 103 
' Remove classes 
Set oLocation = CreateObject("WbemScripting.SWbemLocator") 
'===================
'If this is a Domain Controller, bail!
'===================
Set oWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colComputer = oWMI.ExecQuery _
("Select DomainRole from Win32_ComputerSystem")
For Each oComputer in colComputer
 if (oComputer.DomainRole = 4 or oComputer.DomainRole = 5) then
   'wscript.quit
 Else
'==================
'If it is NOT a domain controller, then continue gathering info 
'and stuff it into WMI for later easy retrieval
'==================

Set oServices = oLocation.ConnectServer(,"root\cimv2") 
set oNewObject = oServices.Get("CM_LocalGroupMembers") 
oNewObject.Delete_ 
'==================
'Get the local Group Names
'==================
Dim iGroups(300)
i=0
Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colGroup = objWMIService.ExecQuery("select * from win32_group where localaccount=1")
for each obj in colGroup
  igroups(i)=obj.Name
  i=i+1
next
'===============
'Get all of the names within each group
dim strLocal(300)
k=0
Set oLocation = CreateObject("WbemScripting.SWbemLocator") 
Set oServices = oLocation.ConnectServer(, "root\cimv2" ) 

'group name, domain name, user or group
for j = 0 to i-1

squery = "select partcomponent from win32_groupuser where groupcomponent = ""\\\\" &_
 strComputer & "\\root\\cimv2:Win32_Group.Domain=\""" & strComputer &_
 "\"",Name=\""" &igroups(j) & "\""""" 

Set oInstances = oServices.ExecQuery(sQuery) 
 FOR EACH oObject in oInstances 
  strLocal(k)=igroups(j) & "!" & oObject.PartComponent

  k=k+1

 Next
next
'==================
'Drop that into a custom wmi Namespace
'==================


' Create data class structure 
Set oDataObject = oServices.Get 
oDataObject.Path_.Class = "CM_LocalGroupMembers" 
oDataObject.Properties_.add "Account" , wbemCimtypeString 
oDataObject.Properties_("Account").Qualifiers_.add "key" , True 
oDataObject.Properties_.add "Domain" , wbemCimtypeString
oDataObject.Properties_.add "Category" , wbemCimtypeString
oDataObject.Properties_.add "Type" , wbemCimtypeString
oDataObject.Properties_.add "Name" , wbemCimtypeString
oDataObject.Properties_("Name").Qualifiers_.add "key" , True
oDataObject.Put_ 

for m = 0 to k-1
Set oNewObject = oServices.Get("CM_LocalGroupMembers" ).SpawnInstance_ 
str0 = Split(strLocal(m), "!", -1, 1)
str1 = Split(str0(1), "," , -1, 1) 
str2 = Split(str1(0), "\" , -1, 1) 
str4 = Split(str2(4), Chr(34), -1, 1) 


' The Account name or Group Name is inside the quotes after the comma 
str3 = Split(str1(1), Chr(34), -1, 1) 
' if the wmi source name is the same as the domain name inside the quotes, it' s a local account 
' str2(2) is the wmi source name, str4(1) is the domain name inside the quotes. 
If lcase(str2(2)) = lcase(str4(1)) Then 
oNewObject.Type = "Local" 
Else 
oNewObject.Type = "Domain" 
End If
oNewObject.Domain = str4(1) 
oNewObject.Account = str3(1) 
oNewObject.Name = str0(0)
Select Case lcase(str4(0))
  case "cimv2:win32_useraccount.domain="
   oNewObject.Category = "UserAccount"
  Case "cimv2:win32_group.domain="
   oNewObject.Category = "Group"
  Case "cimv2:win32_systemaccount.domain="
   oNewObject.Category = "SystemAccount"
  case else
   oNewObject.Category = "unknown"
end select
oNewObject.Put_ 
Next

 end if
Next

wscript.quit
======================================================================

- Click on the Validation Tab, and change Severity to "Information - no Windows Event Message". Retain the check box for "report a non-compliance event when this instance count fails, of Greater than 0. Click Ok
- In Applicability Tab select "All Windows Platforms."

2) Create a DCM Baseline to target to a collection (If you are gathering information for all clients + servers, you can consider targeting the "All Systems" Collection.). Add the CI to the "These applications and general configuration items are required and must be properly configured"
When you assign, you are required to select a schedule. I recommend a Simple Schedule, and to make it be the same as your existing Simple Hardware Inventory schedule, i.e., if you have Hinv every 3 days, make this every 3 days.

3) Add the mof snippet to the bottom of sms_def.mof on your primarty sites' inboxes\clifiles.src\hinv

//=====================Local Group Members, Includes Administrators
//Pre-requisite: recurring Advertisement, or Recurring DCM Baseline/CI
//====================================================================
#pragma deleteclass ("LocalGroupMembers",NOFAIL)
[ SMS_Report (TRUE),
SMS_Group_Name ("LocalGroupMembers"),
SMS_Class_ID ("CUSTOM|LocalGroupMembers|1.0") ]
class cm_LocalGroupMembers : SMS_Class_Template
{
[SMS_Report (TRUE), key ] string Account;
[SMS_Report (TRUE) ] string Category;
[SMS_Report (TRUE) ] string Domain;
[SMS_Report (TRUE), key ] string Name;
[SMS_Report (TRUE) ] string Type;
};

A sample report if you would like to get the list of machines with users' being granted administrators rights is as below.
The query below is working on the assumption that the machines are not "hot seats".

select CS.Name0 [Machinename], account0 [Account Name],lgm.name0 [Groupname] ,lgm.type0 [Accounttype] from v_gs_localgroupmembers0 lgm
left join v_GS_COMPUTER_SYSTEM CS on CS.ResourceID = lgm.resourceid
where CS.UserName0 like '%'+lgm.account0 and lgm.name0 = 'Administrators'


Wednesday, April 30, 2014

Removing Orphaned Packages from SCCM Child Site

Packages that are deleted at a parent site can be orphaned at a child site if the child site unavailable or down at the time of deletion or the replication process is unsuccessful. You won’t be able to delete those packages from child site because they will be locked in the console as the packages originate from the Central Site. In this case, we will need to use the backdoor to fix the problem by modifying the package record from the child site database. Only when this is done, we will be allowed to delete the package from the child site SCCM console.

Procedure to Remove Orphan Packages

To remove orphan packages from the SQL Server database, please follow the below

** You will need to have SA rights for these actions

1. Open SQL Server Management Studio, and use the site database of the child site cs1(SMS_CHILD).

2. Type and run the following command in the query window:

select PkgId, Name, SourceSite from SMSPackages

3. Search for the PkgID file that you want to remove.

4. Type and run the following command in the query window:

Update SMSPackages Set SourceSite='<Child Site Code>' Where PkgID= '<Package ID>'

5. The package is now set to a local package and you can delete it from within the SCCM Administrator console.

Deletion should be performed from the SCCM console instead of via the database level to ensure that the deletion is clean.

Tuesday, April 22, 2014

SCCM Actions via WMI


Using WMIC to trigger SCCM Client Actions from command line:

Request for policy:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000021}" /NOINTERACTIVE

To Evaluate policy:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000022}" /NOINTERACTIVE

Disable Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig CREATE ComponentName="Disable SWDist",Enabled="false",LockSettings="TRUE",PolicySource="local",PolicyVersion="1.0" ,SiteSettingsKey="1" /NOINTERACTIVE

Re-Activate Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig WHERE ComponentName="Disable SWDist" delete /NOINTERACTIVE

Trigger Hardware Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}" /NOINTERACTIVE

Trigger Software Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000002}" /NOINTERACTIVE

Trigger DataDiscoverRecord (DDR) update:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000003}" /NOINTERACTIVE

Force a FULL HW Inventory on next HW-Inv Schedule:
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID="{00000000-0000-0000-0000-000000000001}" DELETE /NOINTERACTIVE

Repair SMS/SCCM Agent on a remote client:
WMIC /node:%MACHINE% /namespace:\\root\ccm path sms_client CALL RepairClient

Repair a list (all clients listed in clients.txt) of remote SCCM Agents:
WMIC /node:@clients.txt /namespace:\\root\ccm path sms_client CALL RepairClient

Wednesday, April 9, 2014

SCCM 2007 Log Files


Client Log Files

* CAS – Content Access Service. Maintains the local package cache.
* Ccmexec.log – Records activities of the client and the SMS Agent Host service.
* CertificateMaintenance.log – Maintains certificates for Active Directory directory service and management points.
* ClientIDManagerStartup.log – Creates and maintains the client GUID.
* ClientLocation.log – Site assignment tasks.
* ContentTransferManager.log – Schedules the Background Intelligent Transfer Service (BITS) or the Server Message Block (SMB) to download or to access SMS packages.
* DataTransferService.log – Records all BITS communication for policy or package access.
* Execmgr.log – Records advertisements that run.
* FileBITS.log – Records all SMB package access tasks.
* Fsinvprovider.log (renamed to FileSystemFile.log in all SMS 2003 Service Packs) – Windows Management Instrumentation (WMI) provider for software inventory and file collection.
* InventoryAgent.log – Creates discovery data records (DDRs) and hardware and software inventory records.
* LocationServices.log – Finds management points and distribution points.
* Mifprovider.log – The WMI provider for .MIF files.
* Mtrmgr.log – Monitors all software metering processes.
* PolicyAgent.log – Requests policies by using the Data Transfer service.
* PolicyAgentProvider.log – Records policy changes.
* PolicyEvaluator.log – Records new policy settings.
* Remctrl.log – Logs when the remote control component (WUSER32) starts.
* Scheduler.log – Records schedule tasks for all client operations.
* Smscliui.log – Records usage of the Systems Management tool in Control Panel.
* StatusAgent.log – Logs status messages that are created by the client components.
* SWMTRReportGen.log – Generates a usage data report that is collected by the metering agent. (This data is logged in Mtrmgr.log.)

Server Log Files

* Ccm.log – Client Configuration Manager tasks.
* Cidm.log – Records changes to the client settings by the Client Install Data Manager (CIDM).
* Colleval.log – Logs when collections are created, changed, and deleted by the Collection Evaluator.
* Compsumm.log – Records Component Status Summarizer tasks.
* Cscnfsvc.log – Records Courier Sender confirmation service tasks.
* Dataldr.log – Processes Management Information Format (MIF) files and hardware inventory in the Configuration Manager 2007 database.
* Ddm.log – Saves DDR information to the Configuration Manager 2007 database by the Discovery Data Manager.
* Despool.log – Records incoming site-to-site communication transfers.
* Distmgr.log – Records package creation, compression, delta replication, and information updates.
* Hman.log – Records site configuration changes, and publishes site information in Active Directory Domain Services.
* Inboxast.log – Records files that are moved from the management point to the corresponding SMS\INBOXES folder.
* Inboxmgr.log – Records file maintenance.
* Invproc.log – Records the processing of delta MIF files for the Dataloader component from client inventory files.
* Mpcontrol.log – Records the registration of the management point with WINS. Records the availability of the management point every 10 minutes.
* Mpfdm.log – Management point component that moves client files to the corresponding SMS\INBOXES folder.
* MPMSI.log – Management point .msi installation log.
* MPSetup.log – Records the management point installation wrapper process.
* Ntsvrdis.log – Configuration Manager 2007 server discovery.
* Offermgr.log – Records advertisement updates.
* Offersum.log – Records summarization of advertisement status messages.
* Policypv.log – Records updates to the client policies to reflect changes to client settings or advertisements.
* Replmgr.log – Records the replication of files between the site server components and the Scheduler component.
* Rsetup.log – Reporting point setup log.
* Sched.log – Records site-to-site job and package replication.
* Sender.log – Records files that are sent to other child and parent sites.
* Sinvproc.log – Records client software inventory data processing to the site database in Microsoft SQL Server.
* Sitecomp.log – Records maintenance of the installed site components.
* Sitectrl.log – Records site setting changes to the Sitectrl.ct0 file.
* Sitestat.log – Records the monitoring process of all site systems.
* Smsdbmon.log – Records database changes.
* Smsexec.log – Records processing of all site server component threads.
* Smsprov.log – Records WMI provider access to the site database.
* SMSReportingInstall.log – Records the Reporting Point installation. This component starts the installation tasks and processes configuration changes.
* SMSSHVSetup.log – Records the success or failure (with failure reason) of installing the System Health Validator point.
* Srvacct.log – Records the maintenance of accounts when the site uses standard security.
* Statmgr.log – Writes all status messages to the database.
* Swmproc.log – Processes metering files and maintains settings.

Admin Console Log Files

* RepairWizard.log – Records errors, warnings, and information about the process of running the Repair Wizard.
* ResourceExplorer.log – Records errors, warnings, and information about running the Resource Explorer.
* SMSAdminUI.log – Records the local Configuration Manager 2007 console tasks when you connect to Configuration Manager 2007 sites.

Management Point Log Files

* MP_Ddr.log – Records the conversion of XML.ddr records from clients, and copies them to the site server.
* MP_GetAuth.log – Records the status of the site management points.
* MP_GetPolicy.log – Records policy information.
* MP_Hinv.log – Converts XML hardware inventory records from clients and copies the files to the site server.
* MP_Location.log – Records location manager tasks.
* MP_Policy.log – Records policy communication.
* MP_Relay.log – Copies files that are collected from the client.
* MP_Retry.log – Records the hardware inventory retry processes.
* MP_Sinv.log – Converts XML hardware inventory records from clients and copies them to the site server.
* MP_Status.log – Converts XML.svf status message files from clients and copies them to the site server.

Mobile Device Management Log Files

* DmClientHealth.log – Records the GUIDs of all the mobile device clients that are communicating with the Device Management Point.
* DmClientRegistration.log – Records registration requests from and responses to the mobile device client in Native mode.
* DmpDatastore.log – Records all the site database connections and queries made by the Device Management Point.
* DmpDiscovery.log – Records all the discovery data from the mobile device clients on the Device Management Point.
* DmpFileCollection.log – Records mobile device file collection data from mobile device clients on the Device Management Point.
* DmpHardware.log – Records hardware inventory data from mobile device clients on the Device Management Point.
* DmpIsapi.log – Records mobile device communication data from device clients on the Device Management Point.
* dmpMSI.log – Records the MSI data for Device Management Point setup.
* DMPSetup.log – Records the mobile device management setup process.
* DmpSoftware.log – Records mobile device software distribution data from mobile device clients on the Device Management Point.
* DmpStatus.log – Records mobile device status messages data from mobile device clients on the Device Management Point.
* FspIsapi.log – Records Fallback Status Point communication data from mobile device clients and client computers on the Fallback Status Point.

Mobile Device Client Log Files

* DmCertEnroll.log – Records certificate enrollment data on mobile device clients.
* DMCertResp.htm (in \temp) – Records HTML response from the certificate server when the mobile device Enroller program requests a client authentication certificate on mobile device clients.
* DmClientSetup.log – Records client setup data on mobile device clients.
* DmClientXfer.log – Records client transfer data for Windows Mobile Device Center and ActiveSync deployments.
* DmCommonInstaller.log – Records client transfer file installation for setting up mobile device client transfer files on client computers.
* DmInstaller.log – Records whether DMInstaller correctly calls DmClientSetup and whether DmClientSetup exits with success or failure on mobile device clients.
* DmInvExtension.log – Records Inventory Extension file installation for setting up Inventory Extension files on client computers.
* DmSvc.log – Records mobile device management service data on mobile device clients.

Operating System Deployment Log Files

* CCMSetup.log – Provides information about client-based operating system actions.
* CreateTSMedia.log – Provides information about task sequence media when it is created. This log is generated on the computer running the Configuration Manager 2007 administrator console.
* DriverCatalog.log – Provides information about device drivers that have been imported into the driver catalog.
* MP_ClientIDManager.log – Provides information about the Configuration Manager 2007 management point when it responds to Configuration Manager 2007 client ID requests from boot media or PXE. This log is generated on the Configuration Manager 2007 management point.
* MP_DriverManager.log – Provides information about the Configuration Manager 2007 management point when it responds to a request from the Auto Apply Driver task sequence action. This log is generated on the Configuration Manager 2007 management point.
* MP_Location.log – Provides information about the Configuration Manager 2007 management point when it responds to request state store or release state store requests from the state migration point. This log is generated on the Configuration Manager 2007 management point.
* Pxecontrol.log – Provides information about the PXE Control Manager.
* PXEMsi.log – Provides information about the PXE service point and is generated when the PXE service point site server has been created.
* PXESetup.log – Provides information about the PXE service point and is generated when the PXE service point site server has been created.
* Setupact.log Setupapi.log Setuperr.log Provide information about Windows Sysprep and setup logs.
* SmpIsapi.log – Provides information about the state migration point Configuration Manager 2007 client request responses.
* Smpmgr.log – Provides information about the results of state migration point health checks and configuration changes.
* SmpMSI.log – Provides information about the state migration point and is generated when the state migration point site server has been created.
* Smsprov.log – Provides information about the SMS provider.
* Smspxe.log – Provides information about the Configuration Manager 2007 PXE service point.
* SMSSMPSetup.log – Provides information about the state migration point and is generated when the state migration point site server has been created.
* Smsts.log – General location for all operating system deployment and task sequence log events.
* TaskSequenceProvider.log – Provides information about task sequences when they are imported, exported, or edited.
* USMT Log loadstate.log – Provides information about the User State Migration Tool (USMT) regarding the restore of user state data.
* USMT Log scanstate.log – Provides information about the USMT regarding the capture of user state data.

Network Access Protection Log Files

* Ccmcca.log – Logs the processing of compliance evaluation based on Configuration Manager NAP policy processing and contains the processing of remediation for each software update required for compliance.
* CIAgent.log – Tracks the process of remediation and compliance. However, the software updates log file, *Updateshandler.log – provides more informative details on installing the software updates required for compliance.
* locationservices.log – Used by other Configuration Manager features (for example, information about the client’s assigned site) but also contains information specific to Network Access Protection when the client is in remediation. It records the names of the required remediation servers (management point, software update point, and distribution points that host content required for compliance), which are also sent in the client statement of health.
* SDMAgent.log – Shared with the Configuration Manager feature desired configuration management and contains the tracking process of remediation and compliance. However, the software updates log file, Updateshandler.log, provides more informative details about installing the software updates required for compliance.
* SMSSha.log – The main log file for the Configuration Manager Network Access Protection client and contains a merged statement of health information from the two Configuration Manager components: location services (LS) and the configuration compliance agent (CCA). This log file also contains information about the interactions between the Configuration Manager System Health Agent and the operating system NAP agent, and also between the Configuration Manager System Health Agent and both the configuration compliance agent and the location services. It provides information about whether the NAP agent successfully initialized, the statement of health data, and the statement of health response.

System Health Validator Point Log Files

* Ccmperf.log -Contains information about the initialization of the System Health Validator point performance counters.
* SmsSHV.log – The main log file for the System Health Validator point; logs the basic operations of the System Health Validator service, such as the initialization progress.
* SmsSHVADCacheClient.log – Contains information about retrieving Configuration Manager health state references from Active Directory Domain Services.
* SmsSHVCacheStore.log – Contains information about the cache store used to hold the Configuration Manager NAP health state references retrieved from Active Directory Domain Services, such as reading from the store and purging entries from the local cache store file. The cache store is not configurable.
* SmsSHVRegistrySettings.log – Records any dynamic changes to the System Health Validator component configuration while the service is running.
* SmsSHVQuarValidator.log – Records client statement of health information and processing operations. To obtain full information, change the registry key LogLevel from 1 to 0 in the following location:HKLM\SOFTWARE\Microsoft\SMSSHV\Logging\@GLOBAL

Desired Configuration Management (DCM) Log Files

* ciagent.log – Provides information about downloading, storing, and accessing assigned configuration baselines.
* dcmagent.log – Provides high-level information about the evaluation of assigned configuration baselines and desired configuration management processes.
* discovery.log – Provides detailed information about the Service Modeling Language (SML) processes.
* sdmagent.log – Provides information about downloading, storing, and accessing configuration item content.
* sdmdiscagent.log – Provides high-level information about the evaluation process for the objects and settings configured in the referenced configuration items.

Wake On LAN Log Files

* Wolmgr.log – Contains information about wake-up procedures such as when to wake up advertisements or deployments that are configured for Wake On LAN.
* WolCmgr.log – Contains information about which clients need to be sent wake-up packets, the number of wake-up packets sent, and the number of wake-up packets retried.

Software Updates Site Server Log Files

* ciamgr.log – Provides information about the addition, deletion, and modification of software update configuration items.
* distmgr.log – Provides information about the replication of software update deployment packages.
* objreplmgr.log – Provides information about the replication of software updates notification files from a parent to child sites.
* PatchDownloader.log – Provides information about the process for downloading software updates from the update source specified in the software updates metadata to the download destination on the site server.
* replmgr.log – Provides information about the process for replicating files between sites.
* smsdbmon.log – Provides information about when software update configuration items are inserted, updated, or deleted from the site server database and creates notification files for software updates components.
* SUPSetup – Provides information about the software update point installation. When the software update point installation completes, Installation was successful is written to this log file.
* WCM.log – Provides information about the software update point configuration and connecting to the Windows Server Update Services (WSUS) server for subscribed update categories, classifications, and languages.
* WSUSCtrl.log – Provides information about the configuration, database connectivity, and health of the WSUS server for the site.
* wsyncmgr.log -Provides information about the software updates synchronization process.

WSUS Server Log Files

* Change.log – Provides information about the WSUS server database information that has changed.
* SoftwareDistribution.log – Provides information about the software updates that are synchronized from the configured update source to the WSUS server database.

Software Updates Client Computer Log Files

* CAS.log – Provides information about the process of downloading software updates to the local cache and cache management.
* CIAgent.log – Provides information about processing configuration items, including software updates.
* LocationServices.log – Provides information about the location of the WSUS server when a scan is initiated on the client.
* PatchDownloader.log – Provides information about the process for downloading software updates from the update source to the download destination on the site server. This log is only on the client computer configured as the synchronization host for the Inventory Tool for Microsoft Updates.
* PolicyAgent.log – Provides information about the process for downloading, compiling, and deleting policies on client computers.
* PolicyEvaluator – Provides information about the process for evaluating policies on client computers, including policies from software updates.
* RebootCoordinator.log – Provides information about the process for coordinating system restarts on client computers after software update installations.
* ScanAgent.log – Provides information about the scan requests for software updates, what tool is requested for the scan, the WSUS location, and so on.
* ScanWrapper – Provides information about the prerequisite checks and the scan process initialization for the Inventory Tool for Microsoft Updates on Systems Management Server (SMS) 2003 clients.
* SdmAgent.log – Provides information about the process for verifying and decompressing packages that contain configuration item information for software updates.
* ServiceWindowManager.log – Provides information about the process for evaluating configured maintenance windows.
* smscliUI.log – Provides information about the Configuration Manager Control Panel user interactions, such as initiating a Software Updates Scan Cycle from the Configuration Manager Properties dialog box, opening the Program Download Monitor, and so on.
* SmsWusHandler – Provides information about the scan process for the Inventory Tool for Microsoft Updates on SMS 2003 client computers.
* StateMessage.log – Provides information about when software updates state messages are created and sent to the management point.
* UpdatesDeployment.log – Provides information about the deployment on the client, including software update activation, evaluation, and enforcement. Verbose logging shows additional information about the interaction with the client user interface.
* UpdatesHandler.log – Provides information about software update compliance scanning and about the download and installation of software updates on the client.
* UpdatesStore.log – Provides information about the compliance status for the software updates that were assessed during the compliance scan cycle.
* WUAHandler.log – Provides information about when the Windows Update Agent on the client searches for software updates.
* WUSSyncXML.log – Provides information about the Inventory Tool for the Microsoft Updates synchronization process. This log is only on the client computer configured as the synchronization host for the Inventory Tool for Microsoft Updates.

Windows Update Agent Log File

* WindowsUpdate.log – Provides information about when the Windows Update Agent connects to the WSUS server and retrieves the software updates for compliance assessment and whether there are updates to the agent components.

Wednesday, March 26, 2014

Http 500 on SCCM Reports


If you try to open a SCCM report especially if you reference against a big collection (i.e All Systems etc) , you might get an generic HTTP 500 error. Most probably, the problem is related to the different report limitations in both: SCCM and IIS.

The SCCM reporting point has a 10.000 rows limit. 

This limit can be expanded by changing the registry. The registry value on the SMS or SCCM Reporting Point server must be modified to allow for returning a larger Row Set.

1) You can change the limit by modifying the registry on the reporting point machine.
Under the HKEY_LOCAL_MACHINE\Software\Microsoft\SMS\Reporting key, add the DWORD valueRowcount and assign it the value for your desired maximum limit.

The maximum row count in decimal is 32767.
If you need to return more than 32,767 records, you can set the row count to 0xffffffff hexadecimal, which will return all rows. However, this significantly increases the workload on the SMS site database.

2) The registry change above will allow you to run reports up to 50.000 rows. If you need more, you have to change the ASP buffer size within the IIS server.

For IIS6
You need to adjust the AspBufferingLimit setting. The AspBufferingLimit property sets the maximum size of the ASP buffer. The default is approximately 4 MB. 
To change the default, open %WindowsRoot%\System32\InetSrv\MetaBase.xml and search for “AspBufferingLimit”. Adjust the setting to allow for 1 MB per 1000 records. You can make changes to the MetaBase.xml file while IIS is running only if the edit-while-running feature is enabled. Otherwise, you must stop IIS before editing the MetaBase.xml file.

For IIS 7.x
Change the setting in the IIS Manager -> ASP -> Limits Properties.

Tuesday, March 18, 2014

Backlogs for SCCM RPL/RPT files

For SCCM administrator having big environments, one of the issues in such environments is backlogging.
if the number of files in an inbox reached critical level, SCCM will not be able to handle the new files that comes in and also whatever that is in the backlog unless you stop all data transferring between sites for several days.  Try to run "DIR /P" command in folder with million files and you will see it takes 3-5 minutes. Windows Explorer hangs when you try to open.

All your changes may be delayed for days and even weeks or changes already happened on client side (package installed, new update lists, updates to collections.. you name it :)) but SCCM server is not updated because it has yet to processed status files yet.

How to resolve this?
Follow the below

1) Stop all SCCM services. It may take up to 10-15 minutes to stop SMS_EXECUTIVE service. (Have some patience to allow it to stop properly and not kill the process :)

2) Create a "DELAY” folder under <SCCM_INSTALL_PATH>\inboxes\replmgr.box\incoming
and move all RPT files from replmgr.box\incoming to delay folder.

3) Start all SCCM Related services which was stopped in step 1.

Watch replmgr.box\incoming folder. Once SCCM finished processing old files (number of files in the folder will be dropped) you can start moving back RPT files. It should be done in blocks.

The below is something that would help to ease the pain of having to manually move the file back into the incoming folder.
Create the batch file in the Delay folder which you create in step 2.

@echo off & setlocal EnableDelayedExpansion
set LIM=300
for %%i in (*.rpt) do (
set /A N+=1
move “%%i” “..”
if !N! geq !LIM! (TimeOut 3600 & set /A LIM+=300)
)
:Complete

Wednesday, March 5, 2014

Dll, config file in SCCM packages cannot be distributed.

A package which I packaged for SCCM do not seem to be distributed to Distributions points after a couple of days despite re-packaging.
The package status remains at install pending for a extended period of time.
In my case my package contained a dll files.

It was found that this is due to configuration in the applicationhost.config file located on c:\windows\system32\inetsrv\config. TheDLL files are filtered by the distribution point.

To determine this issue, the following was done

1) Look at the IIS logs for on the source DP.


2) It was found that the http 500 was encountered for DLL file types

To resolve this issue, the below was removed from the applicationhost.config file
Look for the below <add fileExtension=".dll" allowed="false" /> in the file.
It should be found within the tag of <requestFIltering>

<requestFiltering>
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
<add fileExtension=".asa" allowed="false" />
<add fileExtension=".asax" allowed="false" />
<add fileExtension=".ascx" allowed="false" />
<add fileExtension=".master" allowed="false" />
<add fileExtension=".skin" allowed="false" />
<add fileExtension=".browser" allowed="false" />
<add fileExtension=".sitemap" allowed="false" />
<add fileExtension=".config" allowed="false" />
<add fileExtension=".cs" allowed="false" />
<add fileExtension=".csproj" allowed="false" />
<add fileExtension=".vb" allowed="false" />
<add fileExtension=".vbproj" allowed="false" />
<add fileExtension=".webinfo" allowed="false" />
<add fileExtension=".licx" allowed="false" />
<add fileExtension=".resx" allowed="false" />
<add fileExtension=".resources" allowed="false" />
<add fileExtension=".mdb" allowed="false" />
<add fileExtension=".vjsproj" allowed="false" />
<add fileExtension=".java" allowed="false" />
<add fileExtension=".jsl" allowed="false" />
<add fileExtension=".ldb" allowed="false" />
<add fileExtension=".dsdgm" allowed="false" />
<add fileExtension=".ssdgm" allowed="false" />
<add fileExtension=".lsad" allowed="false" />
<add fileExtension=".ssmap" allowed="false" />
<add fileExtension=".cd" allowed="false" />
<add fileExtension=".dsprototype" allowed="false" />
<add fileExtension=".lsaprototype" allowed="false" />
<add fileExtension=".sdm" allowed="false" />
<add fileExtension=".sdmDocument" allowed="false" />
<add fileExtension=".mdf" allowed="false" />
<add fileExtension=".ldf" allowed="false" />
<add fileExtension=".ad" allowed="false" />
<add fileExtension=".dd" allowed="false" />
<add fileExtension=".ldd" allowed="false" />
<add fileExtension=".sd" allowed="false" />
<add fileExtension=".adprototype" allowed="false" />
<add fileExtension=".lddprototype" allowed="false" />
<add fileExtension=".exclude" allowed="false" />
<add fileExtension=".refresh" allowed="false" />
<add fileExtension=".compiled" allowed="false" />
<add fileExtension=".msgx" allowed="false" />
<add fileExtension=".vsdisco" allowed="false" />
</fileExtensions>
<verbs allowUnlisted="true" applyToWebDAV="true" />
<hiddenSegments applyToWebDAV="true">
<add segment="web.config" />
<add segment="bin" />
<add segment="App_code" />
<add segment="App_GlobalResources" />
<add segment="App_LocalResources" />
<add segment="App_WebReferences" />
<add segment="App_Data" />
<add segment="App_Browsers" />
</hiddenSegments>

3) Restart IIS
4) Monitor the DP

Tuesday, September 17, 2013

SCCM Patch Compliance Report for Machines by Wildcard

As an add on to a previous post I had for the patch compliance, the below query is to do the same thing but that it will allow you to list the all machines that you require information as well as using a wildcard (i.e for machine name starting with ABC change the wildcard underlined to 'ABC%')

select
   VRS.Name0,
   catinfo2.CategoryInstanceName as UpdateClassification,
            ui.BulletinID as BulletinID,
            ui.DatePosted,
   ui.DateRevised,        
            ui.ArticleID as ArticleID,
            ui.Title as Title,        
   ui.InfoURL as InformationURL
from v_UpdateComplianceStatus css
left join v_R_System VRS on VRS.ResourceID = css.ResourceID
join v_UpdateInfo ui on ui.CI_ID=css.CI_ID
join v_CICategories_All catall on catall.CI_ID=ui.CI_ID
join v_CategoryInfo catinfo on catall.CategoryInstance_UniqueID = catinfo.CategoryInstance_UniqueID and catinfo.CategoryTypeName='Company'
join v_CICategories_All catall2 on catall2.CI_ID=ui.CI_ID
join v_CategoryInfo catinfo2 on catall2.CategoryInstance_UniqueID = catinfo2.CategoryInstance_UniqueID and catinfo2.CategoryTypeName='UpdateClassification'
left join v_CITargetedMachines ctm on ctm.CI_ID=css.CI_ID and ctm.ResourceID = VRS.ResourceID
left join (
                        select atc.CI_ID, Deadline=min(a.EnforcementDeadline) from v_CIAssignment a
                        join v_CIAssignmentToCI atc on atc.AssignmentID=a.AssignmentID
                        group by atc.CI_ID) cdl   on cdl.CI_ID=css.CI_ID

where vrs.Active0 = 1and css.Status=2 and VRS.Name0 like '%'
order by VRS.name0 ,catinfo.CategoryInstanceName, catinfo2.CategoryInstanceName, ui.ArticleID

Friday, September 6, 2013

SCCM Patch Compliance - Listing required outstanding patches by server

The below query will enable you to get the patches that are required but has yet to be installed by server.
Replace the parameter @machinename with the server that you are referencing against.

declare @RscID int;
select @RscID=ResourceID from v_R_System where ((Name0 = @machinename) and (Active0 = 1));

select
catinfo2.CategoryInstanceName as UpdateClassification,
            ui.BulletinID as BulletinID,
            ui.DatePosted,
ui.DateRevised,        
            ui.ArticleID as ArticleID,
            ui.Title as Title,          
ui.InfoURL as InformationURL
from v_UpdateComplianceStatus css
join v_UpdateInfo ui on ui.CI_ID=css.CI_ID
join v_CICategories_All catall on catall.CI_ID=ui.CI_ID
join v_CategoryInfo catinfo on catall.CategoryInstance_UniqueID = catinfo.CategoryInstance_UniqueID and catinfo.CategoryTypeName='Company'
join v_CICategories_All catall2 on catall2.CI_ID=ui.CI_ID
join v_CategoryInfo catinfo2 on catall2.CategoryInstance_UniqueID = catinfo2.CategoryInstance_UniqueID and catinfo2.CategoryTypeName='UpdateClassification'
left join v_CITargetedMachines ctm on ctm.CI_ID=css.CI_ID and ctm.ResourceID = @RscID
left join (
                        select atc.CI_ID, Deadline=min(a.EnforcementDeadline) from v_CIAssignment a
                        join v_CIAssignmentToCI atc on atc.AssignmentID=a.AssignmentID
                        group by atc.CI_ID) cdl   on cdl.CI_ID=css.CI_ID
where  css.ResourceID = @RscID
and ((css.Status=2) )
order by catinfo.CategoryInstanceName, catinfo2.CategoryInstanceName, ui.ArticleID

Output of the report will be in the format as below when performed via SSRS


Wednesday, August 28, 2013

SCCM Query to get Logon Information

There was an entry in the MSFT System Center forum was request for some form of assistance to retrieve information for the last console logon for machines which I posted .
Heaving posted that I decided to add in something extra to include the number of console logons to the machine as well as the Total Duration. Hopefully this helps anyone who needs this.

select VRS.Name0 as 'Computer Name'
, Resource_Domain_OR_Workgr0
, User_Name0 'Last Logon Name'
, VOS.Caption0
,VOS.CSDVersion0
,VSC.LastConsoleUse0
,VSC.NumberOfConsoleLogons0 'Total Console Logons Counts'
,VSC.TotalUserConsoleMinutes0 'Total Console Logon Minutes'

from v_R_System VRS 
left join dbo.v_GS_OPERATING_SYSTEM VOS on VRS.ResourceID = VOS.ResourceID
left join dbo.v_GS_SYSTEM_CONSOLE_USER VSC on VSC.ResourceID = VRS.ResourceID

Thursday, June 27, 2013

Object Replication Manager (objreplmgr) on child site failed to insert .CID and .SDM files


I was presented with an issue whereby software updates (configuration items) were not replicating from the central parent site down to a particular child primary site. The symptoms of this being that if a certain update list, update package, or update deployment contained one of the missing updates (CI_items) then the effected object(s) would not appear in the console, and therefore I cannot deploy the effected update(s) at the child site

In this scenario I found a backlog of .CID files in the inbox folder below, each .CID file representing an update which couldn't be processed.

\inboxes\objmgr.box\INCOMING\retry

The retry is attempted 100 times and then the .CID is place in the ‘bad’ folder
\inboxes\objmgr.box\INCOMING\retry\BAD

When SMS_OBJECT_REPLICATION_MANAGER attempts to process the effected CI’s the following is logged to the objreplmgr.log which indicates the failure:

Processing replication file d:\Microsoft Configuration Manager\inboxes\objmgr.box\INCOMING\RetryGL_42586.CID in retry.


Failed to insert Object 6298a02f-0a6a-4f34-b832-08059b682b63 from replication file d:\Microsoft Configuration Manager\inboxes\objmgr.box\INCOMING\RetryGL_48796.CID.

On to the resolution, I found that running the following 6 SQL queries on the effected child sites resolved the issue:

**Note that the ID’s may be different for each site. Run the query Select * from CI_Types to get the proper list. We need to delete the following types: SoftwareUpdate, SoftwareUpdateBundle and AuthorizationList.
Please do this before you run the first query in italic

Delete from CI_ConfigurationItems Where CIType_ID in (1, 6, 8);
Update CI_SDMPackages set IsDeleted = 1 where SourceSite = 'ZZZ';
Delete from CI_ComplianceHistory where isdetected = 1
Delete from CI_Compliancehistory where isdetected = 0
Delete from CI_SDMPackages where isdeleted =1 and sourcesite = 'ZZZ'
Exec sp_DeleteOldSDMPackageData 0;


* note: replace ZZZ with the site code of your central site (or the active SUP which is the furthest upstream’)
Running the above queries will purge Software Updates data from the effected child site.
You should then wait about 30 minutes and then restart the following services on the effected child site:

SMS_EXECUTIVE
SMS_COMPONENT_MANAGER

The final step is to initiate a full site replication, this can be done using the heirarchy maintenance tool (syncchild option) or by place a file called .SHA * in the objmgr.box on the parent site.

* .SHA – replace with the 3 digit site code of the desired child site you wish to replicate.

Allow up to 24 hours for the site replication to complete, when it finishes you should have a fully matching compliment of updates on the central site and child primary site.

You can monitor the objreplmgr.log for successful insertion of .CID and .SDM items, and you should also find that the folder \inboxes\objmgr.box\INCOMING\retry does not contain any items for retry.

Friday, April 19, 2013

SCCM Client Verbose Logging



Though SCCM logs are pretty comprehensive but it's some how short of the additional informaiton that Techies need to get more insight into a error.

The procedure below will enable you to just do that.

Apply the changes to the machine which you need the verbose logging.

Enabling Debug and Verbose Logging

To enable debug logging after installation, create the following registry key:

HKLM\SOFTWARE\Microsoft\CCM\Logging\debuglogging


To enable verbose logging after installation, change the following value to 0. You will need to right click on the @Global key and change permissions to allow the current user to change the data in the key.

HKLM\Software\Microsoft\CCM\Logging\@Global\Loglevel


X64

HKLM\Software\Wow6432Node\Microsoft\CCM .


X86
HKLM\Software\Microsoft\CCM

Monday, July 16, 2012

SCCM Package Stuck at "Install Pending" State Persistently


One of my SCCM Primary Site servers encountered some issues over the past week and at this time a package was being copied to all Primary Site Servers including the one having issues.

After the issue on the Primary Site Server is resolved, it has been found that after repeated attempts to remove and re-copy the package will end up having a similiar frustrating outcome of the package showing up as "Install Pending"

The method which was used to resolve this requires modification to the SCCM SQL Database tables directly (Attempt it at your own risk)

1) Remove the assigned DP from the Package and allow some time for the changes to take effect. Only proceed to step 2 once you have verified that the package is not at "Install Pending" state

2) Logon to the SQL Database for SCCM on Both top-tier and parent primary site server.
Run the SQL Query below against the PkgStatus table in the SCCM Database

Delete FROM PkgStatus WHERE ID='<Package ID>' AND SiteCode = '<Site Code>'

3) Give it some time before adding the DP to the same package

The procedure is applicable for all DPs inclusive of BDPs

Wednesday, February 8, 2012

Removing applications from machines without MSI packages

In SCCM, removing of any applications is using msiexec /x <msi package name>
However this command requires msi package to be available on the client itself. Of course you can say that its not not issue that the package is readily available. Well, think again. Consider this, example Skype that was installed 2 years back on a machine perhaps version 2.0. The current version of Skype is version 4.2 and you are unable to locate the msi package for version 2.0 anyway on the internet and you have 200 clients to uninstall. What can you do.
To overcome this, I have created a vbs to perform the same actions as if you are removing the application fromt the add remove program from the control panel.
How this works, there is actually an uninstall string that is kept in the registry for this purpose. If we can retrieve this value, we can perform the same.
The key location for various products unsintallation is at
Software\Microsoft\Windows\CurrentVersion\Uninstall\<Product_GUID>
Take note that the product GUID  is unique to each msi package.
The below is the vbs that i have created to remove skype
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set WshShell = WScript.CreateObject("WScript.Shell")

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Subkey
strValueName = "DisplayName"
oReg.GetStringValue _
   HKEY_LOCAL_MACHINE,strKeyPath,strValueName,StringValue

if instr(lcase(stringvalue),"skype") > 0 then

strValueName = "uninstallstring"
oReg.GetStringValue _
   HKEY_LOCAL_MACHINE,strKeyPath,strValueName,StringValue
wscript.echo stringvalue
wshshell.run stringvalue & " /quiet /norestart"
end if
Next

Error re-running SCCM Advertisement

In SCCM for advertisement when you assign the particular advertisement to be mandatory, the advertisement will only run once and if you attempt to rerun the same advertisement on the same machine you will get the error as shown in the screenshot below.

To overcome this issue, do the following
 
  1. launch regedit.exe on the machine facing the issue
  2. Navigate to the following key
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Mobile Client\Software Distribution\Execution History\System]
  3. You will find various keys with the package name that has been previously executed on the machine (example HUB000016 etc)
  4. Determine the package name that you are attempting to re-run and delete the key.
    Example if you are attempting to re-run HUB000016 then you should delete the key Hub000016
Once the above is done, you may re-run the advertisement and to expedite the process you may like to refresh the machine policy on the target machine.