Click on Pictures to View

To view a larger version of an image within a post, just click on the picture you want to view :)
Showing posts with label SCCM 2012. Show all posts
Showing posts with label SCCM 2012. Show all posts

Tuesday, November 27, 2018

Comparing AD Group Member Count & SCCM Collection Membership


Recently there was some concern that our SCCM 2012 R2 collections that referenced/queried Active Directory security groups weren't updating or syncing properly.

A simple way I wanted to confirm if this was the case, was to compare the number of assets in a particular AD group with its corresponding SCCM collection.

After some quick research, I discovered a relatively easy PowerShell method to count the number of members in the Active Directory group.


I opened an elevated Powershell window (aka, right-click & Run As Admin...) and ran the following:

PS C:\Windows\system32>  $users = Get-ADGroupMember -Identity 'ADGroupName'
PS C:\Windows\system32>  $users.Count
160
PS C:\Windows\system32>  $users |Export-Csv -path C:\temp\psexport.csv



The first line sets the $users variable.
The second line returns the member count.
The third line exports the members & info as a CSV to the path specified.


So I got the count of members in the AD group, which was 160, and went ahead and exported the information to a CSV file to open within Excel.

Next, I opened the SCCM collection to show the members (can also right click the collection name and click Show Members).  The collection was showing a count of 106 members in the collection information.

On the device membership list screen, do Ctrl + A to select all members, then Ctrl + C to copy the list.
Last, paste the copied data into Excel.


Finally, I used the "Ablebits Data Merge Two Tables" wizard tool to compare the two excel spreadsheets using the computer name as the key.

I had the SCCM info as the main table, and the AD info as the lookup table.



Using the tool's result column (MTW Status), I looked for all non-matching entries - i.e. entries that are in AD group that are not in the SCCM collection.

I found 54 assets that are in the AD group but do not show up in the SCCM collection.  In fact, these assets did not appear to be in SCCM at all.

Further investigation revealed these computers to be dead accounts in Active Directory, so they were inactive altogether and could actually be deleted from Active Directory since they were either disposed or no longer on the domain, etc.

In the end, we proved that SCCM was updating its membership based on the active computer accounts in the AD security group, as expected.



Sources:


Computer in AD Not Appearing in SCCM:
https://social.technet.microsoft.com/Forums/en-US/5923a17c-3994-4bd0-8811-ce2f2e8593f0/computer-in-ad-not-appearing-in-sccm?forum=configmanagerdeployment


How To Export a Collection to CSV in SCCM 2012:
https://community.spiceworks.com/topic/259637-how-to-export-a-collection-to-csv-in-sccm-2012


Powershell Count Members of an AD Group:
http://blogs.microsoft.co.il/skepper/2016/05/31/powershell-count-members-of-a-ad-group/


Ablebits Data Merge Two Tables in Excel Tool:
https://www.ablebits.com/excel-lookup-tables/index.php



Wednesday, July 25, 2018

SCCM SMSTS.log and CMTrace Tool

Often times when experiencing difficulties with OS deployment using SCCM, it is helpful to know where to find the SMSTS.log file, and use the cmtrace.exe tool to view it.  This can greatly aid your troubleshooting process to find the reason for failure or error codes seen.

According to Prajwal Desai (www.prajwaldesai.com) the smsts.log file changes its location depending on the point in the process of the operating system's installation.

First, open cmtrace.exe to enable log file viewing during the Windows PE phase, open a command prompt.window by pressing the F8 key during the OSD (cmtrace.exe is included in Windows PE).

Navigate to X:\sms\bin\x64 file location and launch cmtrace.exe

Example commands:

              Step 1 - type & press enter:     cd X:\sms\bin\x64

              Step 2 - type & press enter:    cmtrace.exe


Next, in cmtrace.exe tool window, choose File --> Open.

Then navigate to the appropriate location based on where your operating system deployment is at in the install process and open the smsts.log file - below are some locations to look:

These two file locations are for the smsts.log file while during OSD

                  Before the hard drive is formatted and partitioned, look here:

      • X:\Windows\Temp\SMSTSLog\smsts.log

                  After hard drive formatting, look here:

      • X:\SMSTSLOG\smsts.log
                                           
                  Or if copied to C:\
                        
      • C:\_SMSTaskSequence\Logs\SMSTSLog\smsts.log


After OSD and OS is installed, you will want to look in these locations:
       
                 Before SCCM agent is installed, look here:
     
      • C:\_SMSTaskSequence\Logs\SMSTSLog\smsts.log

                 If the Windows OS that was installed is 32-bit, after SCCM agent is installed, look here:
  
      • C:\Windows\System32\CCM\Logs\SMSTSLog\smsts.log

                 If the Windows OS that was installed is 32-bit, after SCCM agent is installed, look here:

      • C:\Windows\SysWOW64\ccm\Logs\SMTSLog\smsts.log


Look in these locations after the task sequence has finished running:

              If Windows OS is 32-bit:
                     
      • C:\Windows\System32\ccm\Logs\smsts.log

               If Windows OS is 64-bit:

      • C:\Windows\SysWOW64\ccm\Logs\smsts.log


Note - your file/folder locations may vary slightly, this is just a general guide of possible locations where the log is frequently found.



SOURCES:

Location of SMSTS Log During SCCM OSD

Trace32/CMTrace.exe Hidden Features

Location of CMTrace.exe during installation of Configuration Manager 2012

How to Open CMTrace During OSD:

How to Open CMTrace in WinPE Like a Boss

Add "CMTrace" During OSD

Copy CMTrace.exe into the Full Windows OS in a task sequence

Wednesday, October 18, 2017

Remove Expired Client Operations - SCCM Admin Console

POWERSHELL - Remove Expired Client Operations in SCCM Admin Console


​​1) Launch Configuration Manager Admin Console
2) File -> Connect via Windows Powershell
SCCM_GUI​

3) Copy and paste below code:

Foreach($CMOperation in Get-CMClientOperation)
{
    If ($CMOperation.IsExpired -eq 1) 
    {
        Remove-CMClientOperation -Id $CMOperation.ID -Force
    }
}


4) After script finishes running, verify Client Operations count = 0:

Get-CMClientOperation | measure

5) Confirm in Configuration Manager Console the Client Operations items = 0





**For a progress display, instead use below code:

Foreach($CMOperation in Get-CMClientOperation)
{
    If ($CMOperation.IsExpired -eq 1) 
    {
$CMOperation.ID
        Remove-CMClientOperation -Id $CMOperation.ID -Force
​ }
}






Thursday, July 7, 2016

SCCM 2012 Installation Status Waiting for Content

We had a machine that showed as "Waiting for Content" for a certain application in the Deployments section of Monitoring in SCCM administration console.

All other machines in the company successfully received the application with successful installation.  So this was a one-off.

Troubleshooting Process:

1) Verified SCCM client was installed correctly and completely.  This meant 7 tabs across two rows in the client window, 11 client actions listed on the Actions Tab, correct assigned site code, and an "installation succeeded" entry in the C:\Windows\ccmsetup\Logs\ccmsetup.log file.

2) Verified software was seen in Software Center with status as Downloading (0% complete)

3)  AppDiscovery.log and AppEnforce.log in C:\Windows\CCM\Logs didn't show anything in particular in regards to the application in question

4)  Verified content was available in the SCCM software repository location and was available on the Distribution Point where the computer was located


Resolution:

In the process of seeing what remote site the computer was at to verify the Distribution Point location, I looked at the IP address of the machine.  It showed to have an IP address in the new IP address scheme we are starting to slowly roll out to all of our sites.

I then remembered that as we roll out the new IP address scheme, whenever the new data subnet deployed to a site was not added to Active Directory Sites and Services, SCCM content could not be downloaded by client computers.

Sure enough, the new subnet that the computer was in was missing from Active Directory Sites and Services.  We added the subnet in, waited a few hours for everything to update, and then checked that the computer began downloading and installing the software.

Wednesday, June 8, 2016

Fix: SCCM 2012 Client Check Shows No Results

This post was copied and slightly modified from Dale's Tech Blog post on the issue.  See bottom for source link.



Computer SCCM client lists "No Results" for "Client Check Result" in the System Center 2012 Console














Problem: SCCM client computer listed as "no results" for "client check result" in the system center 2012 console client monitor. You'll notice on the problem computer that it's missing the ccmeval.log and you'll see errors in the ccmevaltask.log file.

The ccmeval.exe is run from a scheduled task that is created upon installation of the agent. This task is run daily to allow the computer to check-in with the sccm server. More than likely this error condition occurs when a client agent was upgraded, but for some reason the scheduled task wasn’t recreated. On the problem computer you'll see listed under the task results "not registered" or other failure codes.

Solution 1:  On the computer with the problem client, in Task Scheduler under Configuration Manager folder in the Microsoft folder, right click and Run the task Configuration Manager Health Evaluation.  Refresh page, and verify task updates to show “Last Run Time” as the current time (when the task was Run).

If this doesn't fix the issue, try solution 2 below (from Dale's Tech Blog).

Try Solution 2: On the computer with the problem client open the Task Scheduler in Control Panel. Open Microsoft folder in the Task Scheduler Library, then Configuration Manager and delete all listed entries. Initiate the “install client” with the “always install” option checked from within the SCCM 2012 console. The scheduled tasks should be recreated when the agent installs and the computer will start checking in appropriately to the SCCM server. Check the local computers ccmeval.log file for more details.

After implementing one of the above solutions, prompt the client to check in with the SCCM server by running that client’s Data Discovery Collection Cycle either by opening from Control Panel > Configuration Manager, go to Actions Tab, and selecting and running the task, or using Right Click Tools, if installed, in the SCCM console.

Tip:  Open up the Task Scheduler by either typing "task" into the Start Menu search bar, or by opening All Programs > Accessories > System Tools OR go to Control Panel > Administrative Tools


Source:

Thursday, October 15, 2015

SCCM 2012 Query: Installed Application Version

Hello,

So I ran into this today - needed to find all machines in SCCM 2012 that have Microsoft Office 2007 installed but do NOT have service pack version 3 (SP3).

I created the query mentioned below and confirmed that this returned the correct machines by comparing with a colleage's different query version for the same task and checking samples of the machines' Office versions in Resource Explorer.

Here's the method:

In SCCM I looked up a machine that I knew had SP3 installed.  I right clicked and Start -> Resource Explorer -> Hardware -> Installed Applications and found the application in question - in this case Office 2007.  Microsoft Office Professional Plus 2007 was seen under the Display Name.  On the far right of the application entry is the version number.  I took note of both of these.

By the way:

Office ProPlus 2007 Service Pack 2 Version Number is 12.0.6424.1000
Office ProPlus 2007 Service Pack 3 Version Number is 12.0.6612.1000

So in my query I did this for the criteria:

Simple Value Installed Applications - Display Name is equal to Microsoft Office Professional Plus 2007
AND
Simple Value Installed Applications - Version is less than 12.0.6612.1000



You can also do "is not equal to" rather than "is less than."

This returned all the machines that had MS Office ProPlus 2007 service packs below SP3.

This process can of course be modified to query for any software listed in the Applications area of Resource Explorer.

Just in case someone wants it, below is the resulting criteria query language from the selected query options shown above.

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 inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Microsoft Office Professional Plus 2007" and SMS_G_System_ADD_REMOVE_PROGRAMS.Version < "12.0.6612.1000"


Additional Resources:

http://www.4kcc.com/How2/sp_version.html

http://pcsupport.about.com/od/keepingupwithupdates/a/office-service-pack.htm