This SQL query will poll sccm and pull out a report which lists all machines and their OS, most recent boot time and last logged on user:
Select
SD.Name0 'Machine Name',
Caption0 AS [Operating System],
SD.User_Name0 'Last Logged on User Name',
Convert(VarChar(10), OS.LastBootUpTime0, 101) 'Last Boot Date'
From v_R_System SD
Join v_Gs_Operating_System OS on SD.ResourceID = OS.ResourceID
Order By 'Machine Name'
Thursday, 31 July 2014
SCCM 2007 - Client Actions tab
Below is a list of what tasks/roles the various options on the Client Actions tab of the Client Configuration Manager client actually do:
Branch Distribution Point Maintenance Task
verifies any prestaged packages and downloads any that do not exist on the branch distribution point. While Technet does not explicitly state it, I believe this task is useful only on branch distribution points and is ignored on normal clients.
Discovery Data Collection Cycle
causes the client to generate a new discovery data record (DDR). When the DDR is processed by the site server, Discovery Data Manager adds or updates resource information from the DDR in the site database.
File Collection Cycle
When a file is specified for collection, the Microsoft System Center Configuration Manager 2007 software inventory agent searches for that file when it runs a software inventory scan on each client in the site. If the software inventory client agent finds a file that should be collected, the file is attached to the inventory file and sent to the site server. This action differs from software inventory in that it actually sends the file to the site server, so that it can be later viewed using Resource Explorer. This is a part of SCCM inventory functionality.
Hardware Inventory Cycle
collects information such as available disk space, processor type, and operating system about each computer. This is a part of SCCM inventory functionality.
Machine Policy Retrieval & Evaluation Cycle
The client downloads its policy on a schedule. By default, this value is configured to every 60 minutes and is configured with the option Policy polling interval (minutes). However, there might be occasions when you want to initiate ad-hoc policy retrieval from the client—for example, in a troubleshooting scenario or when testing. This action initiates ad-hoc machine policy retrieval from the client outside its scheduled polling interval.
Software Inventory Cycle
collects software inventory data directly from files (such as .exe files) by inventorying the file header information. Configuration Manager 2007 can also inventory unknown files — files that do not have detailed information in their file headers. This provides a flexible, easy-to-maintain software inventory method. You can also have Configuration Manager 2007 collect copies of files that you specify. Software inventory and collected file information for a client can be viewed using Resource Explorer. This is a part of SCCM inventory functionality.
Software Metering Usage Report Cycle
collects the data that allows you to monitor and client software usage.
Software Updates Deployment Evaluation Cycle
initiates a scan for software updates compliance. Before client computers can scan for software update compliance, the software updates environment must be configured.
Software Updates Scan Cycle
Just after a software update installation completes, a scan is initiated to verify that the update is no longer required and to create a new state message that indicates the update has been installed. When the installation has finished but a restart is necessary, the state will indicate that the client computer is pending a restart.
User Policy Retrieval & Evaluation Cycle
Similar to Machine Policy Retrieval & Evaluation Cycle, but this action initiates ad-hoc user policy retrieval from the client outside its scheduled polling interval.
Windows Installer Source List Update Cycle
causes the Product Source Update Manager to complete a full update cycle. When you install an application using Windows Installer, those Windows Installer applications try to return to the path they were installed from when they need to install new components, repair the application, or update the application. This location is called the Windows Installer source location. Windows Installer Source Location Manager can automatically search Configuration Manager 2007 distribution points for the source files, even if the application was not originally installed from a distribution point.
Branch Distribution Point Maintenance Task
verifies any prestaged packages and downloads any that do not exist on the branch distribution point. While Technet does not explicitly state it, I believe this task is useful only on branch distribution points and is ignored on normal clients.
Discovery Data Collection Cycle
causes the client to generate a new discovery data record (DDR). When the DDR is processed by the site server, Discovery Data Manager adds or updates resource information from the DDR in the site database.
File Collection Cycle
When a file is specified for collection, the Microsoft System Center Configuration Manager 2007 software inventory agent searches for that file when it runs a software inventory scan on each client in the site. If the software inventory client agent finds a file that should be collected, the file is attached to the inventory file and sent to the site server. This action differs from software inventory in that it actually sends the file to the site server, so that it can be later viewed using Resource Explorer. This is a part of SCCM inventory functionality.
Hardware Inventory Cycle
collects information such as available disk space, processor type, and operating system about each computer. This is a part of SCCM inventory functionality.
Machine Policy Retrieval & Evaluation Cycle
The client downloads its policy on a schedule. By default, this value is configured to every 60 minutes and is configured with the option Policy polling interval (minutes). However, there might be occasions when you want to initiate ad-hoc policy retrieval from the client—for example, in a troubleshooting scenario or when testing. This action initiates ad-hoc machine policy retrieval from the client outside its scheduled polling interval.
Software Inventory Cycle
collects software inventory data directly from files (such as .exe files) by inventorying the file header information. Configuration Manager 2007 can also inventory unknown files — files that do not have detailed information in their file headers. This provides a flexible, easy-to-maintain software inventory method. You can also have Configuration Manager 2007 collect copies of files that you specify. Software inventory and collected file information for a client can be viewed using Resource Explorer. This is a part of SCCM inventory functionality.
Software Metering Usage Report Cycle
collects the data that allows you to monitor and client software usage.
Software Updates Deployment Evaluation Cycle
initiates a scan for software updates compliance. Before client computers can scan for software update compliance, the software updates environment must be configured.
Software Updates Scan Cycle
Just after a software update installation completes, a scan is initiated to verify that the update is no longer required and to create a new state message that indicates the update has been installed. When the installation has finished but a restart is necessary, the state will indicate that the client computer is pending a restart.
User Policy Retrieval & Evaluation Cycle
Similar to Machine Policy Retrieval & Evaluation Cycle, but this action initiates ad-hoc user policy retrieval from the client outside its scheduled polling interval.
Windows Installer Source List Update Cycle
causes the Product Source Update Manager to complete a full update cycle. When you install an application using Windows Installer, those Windows Installer applications try to return to the path they were installed from when they need to install new components, repair the application, or update the application. This location is called the Windows Installer source location. Windows Installer Source Location Manager can automatically search Configuration Manager 2007 distribution points for the source files, even if the application was not originally installed from a distribution point.
Wednesday, 30 July 2014
Send an email in Powershell
Below is a very basic Powershell script which can be used to send an email. Not super difficult to figure out how this works but can be useful for adding into a scheduled task or as part of remediation script:
$email = @{
From = look_out@dinosaurs.com
To = staff@dinosaurs.com
Subject = "Danger - Incoming Asteroid"
SMTPServer = "mailserver.domainname"
Body = "Danger! Incoming asteroid. Everyone to the escape pods"
}
send-mailmessage @email
NB it's worth mentioning that you need to put the email addresses in quotation marks.
$email = @{
From = look_out@dinosaurs.com
To = staff@dinosaurs.com
Subject = "Danger - Incoming Asteroid"
SMTPServer = "mailserver.domainname"
Body = "Danger! Incoming asteroid. Everyone to the escape pods"
}
send-mailmessage @email
NB it's worth mentioning that you need to put the email addresses in quotation marks.
Friday, 18 July 2014
How the SCCM deploys/installs the CCM Client to a new client/machine
When troubleshooting a failed client install it can be useful to have a basic understanding of how the client installation process actually works. The below is a rough step through of how sccm deploys a client after it discovers a new machine. The following info was mostly cribbed from the MS website but rewritten somewhat:
First, SCCM goes in search of new machines......
1] SCCM finds a new machine and generates a CCR file (Client Configuration
Request). This file contains information about the machine, including the name.
2] The Client Configuration Manager then uses the info in
the CCR file to establish a connection to the Admin$ share on the newly discovered machine.
3] From there the Client Configuration Manager sets up a
connection to the newly discovered machine’s registry (aka IPC$). If you open up the
CCM.log file on the SCCM server you should see this IPC$ connection being
established
4] The core components of the client (MobileClient.tcf and CCMsetup.exe)
are copied from the \\servername\SMS_[sitecode]\bin\I386 share on the SCCM
server into the %windir%\System32\ccmsetup folder on the newly discovered
machine.
5] The Client Configuration Manager checks that the CCMsetup service has started and then disconnects from the client machine. The CCR file is added into the \\servername\SMS_[sitecode]\Inboxes\CCRretry.box. The Client Configuration Manager then does a second check of the newly discovered machine, if the SMS Agent Host (ccmexec) is running it deletes the CCR file.
5] The Client Configuration Manager checks that the CCMsetup service has started and then disconnects from the client machine. The CCR file is added into the \\servername\SMS_[sitecode]\Inboxes\CCRretry.box. The Client Configuration Manager then does a second check of the newly discovered machine, if the SMS Agent Host (ccmexec) is running it deletes the CCR file.
OR
If the Client Configuration Manager establishes that the SMS
Agent Host isn’t running or has encountered a problem then it ill rename the
CCR file to the name of the newly discovered machine and moved into the \\servername\SMS_[sitecode]\Inboxes\CCRretry.box
folder. Client Configuration Manager will check all the logs in this folder every
hour for 7 days before deleting them. This
info can be viewed in the ccm.log file
Meanwhile, bak on the newly discovered machine....
1] CCMsetup.exe starts up and then has a look in the
MobileClient.tcf file. This file contains configuration info which tells the
CCMsetup.exe where to find the Client.msi on the SCCM server. The
MobileClient.tcf file also provides other info such as the SMS Site Code, the
name of the Management Point and the site boundary.
2] CCMsetup.exe then downloads the client.msi file from the \\servername\SMS_[sitecode]\Client\i386
shared folder on the site server (it can also get it from the Management Point
if so configured). The Client.msi installer is installed based on the settings
configured in the SCCM console.
Once the client is installed, it needs to find itself….
1] If the setting has been enabled on the Client Push Installation
properties, the client will automatically be assigned to a site using the
property SMSSITECODE=AUTO which will prompt it to consult Active Directory for
its site assignment. Assuming the AD Schema has been extended, the client will
used LDAP to query AD for its site assignment and management point.
OR
If the AD Schema has not been extended or the property has
not been specified, the client will have a look for a client locator point to
ask for a site assignment and directions to the relevant management point.
2] Once the client has found its default management point,
it will kick off its initial request for policies...
Wednesday, 16 July 2014
WDS not starting - Error 1067: The process terminated unexpectedly
Issue:
“Error 1067: The process terminared unexpectedly” message appears whenever you try to start the Windows Deployment Service
Cause:
Most likely, the last thing you did before the issue occured was to add a new network driver to the bootimage.
Solution:
- Remove the folder “C:\Windows\Temp\PXEBootFiles” on the SCCM Server.
- Remove all bootimages from smspxeimages$ distribution point.
- Remove the drivers that were added to the bootimage.
- Redistribute the bootimage to the distribution points
- Start the WDS Service.
Tuesday, 8 July 2014
Install Updates in Task Sequence not installing
Issue:
In spite of the fact that you have put the Install Software Updates step into your task sequence and specified that either all or only mandatory software updates be installed, the Task Sequence installs no updates but simply breezes through this section of your TS. At this point, your TS may look a bit like this:
When you first logon to your newly build machine, it won't have any updates installed on it.
Cause:
The issue here is that while the CCM client is being installed, it isn't communicating with the SCCM server so isn't aware of what updates are available for it.
Fix:
Essentially, you need to ensure that a full UpdateScan is triggered right after the client has been installed. This will ensure the client talks to the server and sniffs out which updates are available. In order to do this you need to insert an extra step into the Task Sequence:
The text in the command line is as follows:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000113}" /NOINTERACTIVE
If, for whatever reason, you need to trigger any other client actions simpy use the one of the following cmd lines:
‘Hardware Inventory – 00000000-0000-0000-0000-000000000001 ‘Software Inventory – 00000000-0000-0000-0000-000000000002
‘Data Discovery – 00000000-0000-0000-0000-000000000003
‘Machine Policy Assignment Request – 00000000-0000-0000-0000-000000000021
‘Machine Policy Evaluation – 00000000-0000-0000-0000-000000000022
‘Refresh Default Management Point – 00000000-0000-0000-0000-000000000023
‘Refresh Location (AD site or Subnet) – 00000000-0000-0000-0000-000000000024
‘Software Metering Usage Reporting – 00000000-0000-0000-0000-000000000031
‘Sourcelist Update Cycle – 00000000-0000-0000-0000-000000000032
‘Refresh proxy management point – 00000000-0000-0000-0000-000000000037
‘Cleanup policy – 00000000-0000-0000-0000-000000000040
‘Validate assignments – 00000000-0000-0000-0000-000000000042
‘Certificate Maintenance – 00000000-0000-0000-0000-000000000051
‘Branch DP Scheduled Maintenance – 00000000-0000-0000-0000-000000000061
‘Branch DP Provisioning Status Reporting – 00000000-0000-0000-0000-000000000062
‘Software Update Deployment – 00000000-0000-0000-0000-000000000108
‘State Message Upload – 00000000-0000-0000-0000-000000000111
‘State Message Cache Cleanup – 00000000-0000-0000-0000-000000000112
‘Software Update Scan – 00000000-0000-0000-0000-000000000113
‘Software Update Deployment Re-eval – 00000000-0000-0000-0000-000000000114
OOBS Discovery – 00000000-0000-0000-0000-000000000120
‘Data Discovery – 00000000-0000-0000-0000-000000000003
‘Machine Policy Assignment Request – 00000000-0000-0000-0000-000000000021
‘Machine Policy Evaluation – 00000000-0000-0000-0000-000000000022
‘Refresh Default Management Point – 00000000-0000-0000-0000-000000000023
‘Refresh Location (AD site or Subnet) – 00000000-0000-0000-0000-000000000024
‘Software Metering Usage Reporting – 00000000-0000-0000-0000-000000000031
‘Sourcelist Update Cycle – 00000000-0000-0000-0000-000000000032
‘Refresh proxy management point – 00000000-0000-0000-0000-000000000037
‘Cleanup policy – 00000000-0000-0000-0000-000000000040
‘Validate assignments – 00000000-0000-0000-0000-000000000042
‘Certificate Maintenance – 00000000-0000-0000-0000-000000000051
‘Branch DP Scheduled Maintenance – 00000000-0000-0000-0000-000000000061
‘Branch DP Provisioning Status Reporting – 00000000-0000-0000-0000-000000000062
‘Software Update Deployment – 00000000-0000-0000-0000-000000000108
‘State Message Upload – 00000000-0000-0000-0000-000000000111
‘State Message Cache Cleanup – 00000000-0000-0000-0000-000000000112
‘Software Update Scan – 00000000-0000-0000-0000-000000000113
‘Software Update Deployment Re-eval – 00000000-0000-0000-0000-000000000114
OOBS Discovery – 00000000-0000-0000-0000-000000000120
Saturday, 5 July 2014
Advertisement / Package Stuck on “Ready” - Software Distribution currently paused - SCCM 2007
Issue:
Using Client Centre, you can also see that’s something’s not
right because the advertisement is listed as being Ready yet is not installing:
The package you have deployed hasn’t been installed on the
target machine. If you open the Advertisement Status Reoprt for the package,
you encounter no error messages but are instead told that
“The Program for advertisement
(xxxxxx) has not been run yet……Software Distribution is currently paused on
this computer and it has to be resumed before this program can begin”
Cause:
The
Software Distribution has entered a paused state on the client machine. Most likely due to ghosts in the machine...
Resolution:
If you happen to be using Client Centre*, you can simply connect to the client machine and then use the following Client Actions:
If you're not using Client Centre, open up the client machine's registry and change the following registry key:
If you happen to be using Client Centre*, you can simply connect to the client machine and then use the following Client Actions:
If you're not using Client Centre, open up the client machine's registry and change the following registry key:
x86 – HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Mobile
Client\Software Distribution\State\
x64 – HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\SMS\Mobile
Client\Software Distribution\State\
Set the “Paused” key from 1 to 0
Restart ccmexec and keep you fingers crossed it resolves the
issue. If it doesn’t you may wish to consider removing and reinstalling the ccm
client!
*If you're not using Client Centre, an important question to ask yourself is why not? It's awesome
*If you're not using Client Centre, an important question to ask yourself is why not? It's awesome
Tuesday, 1 July 2014
Basic Guide to SCCM Client Install
How SCCM Client Install Works
1. The
client install process is initiated (either via SCCM or from \\SCCMServerName\sms_(sitecode)\client)
2. A
new folder called ccmsetup is created
in the system folder (C:\windows\system32)
3. The
ccmsetup.exe file is downloaded to the ccmsetup folder
4. The
ccmsetup.exe file runs and then kicks off the install. In doing it pulls down
all the other required files from SCCM.
5. Once
all the requisite parts have downloaded, the client.msi will begin and the installation will head toward the
finish
There are two useful log files within the ccmsetup folder which can be used to check on the progress of the client install. These can be found here \\machinename\c$\Windows\system32\ccmsetup and are shown below:
ccmsetup.log – This log file contains all the information about the client install process.
> If there are any problems with the install of the
client, this is the best place to start.
> If everything has worked ok, the end of the log file
should look like the below.
client.msi.log – This log file contains all the information
about the client.msi part of the installation process. It’s a bit harder to
pick through than the ccmsetup.log but you need some help, this is a very good place ot start looking: http://blogs.technet.com/b/sudheesn/archive/2010/05/31/troubleshooting-sccm-part-i-client-push-installation.aspx
Subscribe to:
Posts (Atom)