This could happened because of not supported versions to fix this you need to apply a patch KB2489044. (I ran into this problem today at a customer place and fix is below)
This could happened because of not supported versions to fix this you need to apply a patch KB2489044. (I ran into this problem today at a customer place and fix is below)
http://blog.coretech.dk/confmgr07/collection-for-computers-that-failed-to-run-an-advertisement/
http://blog.coretech.dk/confmgr07/config-mgr-inventory-and-reporting/audit-software-installations/
http://www.myitforum.com/myITToolbar/frame-click.asp?
on error resume next
dim oUIResManager
dim oCache
dim oCacheElement
dim oCacheElements
set oUIResManager = createobject(“UIResource.UIResourceMgr”)
if oUIResManager is nothing then
wscript.echo “Couldn’t create Resource Manager – quitting”
wscript.quit
end if
set oCache=oUIResManager.GetCacheInfo()
if oCache is nothing then
set oUIResManager=nothing
wscript.echo “Couldn’t get cache info – quitting”
wscript.quit
end if
set oCacheElements=oCache.GetCacheElements
for each oCacheElement in oCacheElements
oCache.DeleteCacheElement(oCacheElement.CacheElementID)
next
set oCacheElements=nothing
set oUIResManager=nothing
set oCache=nothing
----------
use this script below …
1. Create a folder and place the following batch files and txt file on it: Collect.bat, TestAll.bat, TestPC.bat, and Computers.txt. The codes for the batch files are given below. Place the name or ip address of the machines in computers.txt (one computer name/ip address per line)
2. Run TestAll.bat
3. A folder named “Result” will be created inside the folder where the batch files are located. This folder will contain the log files of the machines that you entered in computers.txt
A. Collect.bat
MD .\Result\%1
MD .\Result\%1\CCMLog
MD .\Result\%1\CCMSETUPLog
xcopy \\%1\admin$\system32\ccm\logs\*.* .\Result\%1\CCMLog /E /Y
xcopy \\%1\admin$\system32\ccmsetup\*.log .\Result\%1\CCMSETUPLog /E /Y
B. TestAll.bat
rd /Q /S .\Result_OLD
Move /Y .\Result .\Result_OLD
rd /Q /S .\Result
MD .\Result
del FailPing.txt
del FailConnect.txt
del Succeed.txt
for /f %%i in (computers.txt) do call TestPC %%i
C. TestPC.bat
@echo off
REM usage: TestPC PCName
if not %1. == . goto INSTALL
Echo Usage: TestPC PCName
goto END
:INSTALL
REM @echo on
Echo Now test %1
Echo Now try to ping %1
ping %1 -n 1 | find /i “ttl=” && Goto ONLINE
Goto OFFLINE
:ONLINE
Echo can ping %1
Echo Now try to connect to \\%1\Admin$
Dir \\%1\Admin$ >nul
If ERRORLEVEL=1 goto ConnectionFailed
Echo Connection test succeeded for %1. Can connect to \\%1\admin$.
Echo %1 >>.\result\Succeed.txt
Echo Now collecting data
call Collect.bat %1
goto END
:OFFLINE
echo cannot ping %1
Echo %1 >>.\result\FailPing.txt
goto Failed
:ConnectionFailed
Echo cannot connect to \\%1\admin$.
Echo %1 >>.\result\FailConnect.txt
goto Failed
:Failed
Echo Connection test failed for %1
:END
Echo.
D. Computers.txt
to get the consolidated Report for all your deployments / instead of depending on dashboard you can view this PVT Report
Source:- http://blog.coretech.dk/kea/status-report-for-software-update-deployments/
Select Deploymentname, Available, Deadline,
cast(cast(((cast([Compliant] as float) / (ISNULL([Compliant], 0) + ISNULL([Enforcement state unknown], 0) + ISNULL([Successfully installed update(s)], 0) + ISNULL([Failed to install update(s)], 0) + ISNULL([Installing update(s)], 0) + ISNULL([Waiting for another installation to complete], 0) + ISNULL([Pending system restart], 0) + ISNULL([Downloading update(s)], 0)))*100) as Numeric(10,2)) as varchar(256)) + '%' AS '%Compliant',
[Compliant],
[Enforcement state unknown],
[Successfully installed update(s)],
[Failed to install update(s)],
[Installing update(s)],
[Waiting for another installation to complete],
[Pending system restart],
[Downloading update(s)]
From
(select
a.AssignmentName as DeploymentName,
a.StartTime as Available,
a.EnforcementDeadline as Deadline,
sn.StateName as LastEnforcementState,
count(*) as NumberOfComputers
from v_CIAssignment a
join v_AssignmentState_Combined assc
on a.AssignmentID=assc.AssignmentID
join v_StateNames sn
on assc.StateType = sn.TopicType and sn.StateID=isnull(assc.StateID,0)
group by a.AssignmentName, a.StartTime, a.EnforcementDeadline,
sn.StateName) as PivotData
PIVOT
(
SUM (NumberOfComputers)
FOR LastEnforcementState IN
( [Compliant],
[Enforcement state unknown],
[Successfully installed update(s)],
[Failed to install update(s)],
[Installing update(s)],
[Waiting for another installation to complete],
[Pending system restart],
[Downloading update(s)])
) AS pvt
|
SMS to SCCM Auto Migration Script
Copy.bat
xcopy /y ccmsetup.exe c:\windows\temp\
xcopy /y ccmclean.exe c:\windows\temp\
xcopy /y install.bat c:\windows\temp\
schtasks /CREATE /SC MINUTE /mo 90 /TN Migration /TR "C:\windows\temp\install.bat" /RU SYSTEM
schtasks /CREATE /SC MINUTO /mo 90 /TN Migration /TR "C:\windows\temp\install.bat" /RU SYSTEM
Install.bat
C:\windows\temp\ccmclean.exe /client /q
C:\windows\temp\Ccmsetup.exe /mp:ServerName SMSSITECODE=Sitecode
SCHTASKS /delete /TN Migration /F
Advertise the Copy.bat then automatically clients will installing the sccm
a. Back up the site database on the current site database server and restore it on the new site database server computer using the SQL Server Management Studio.
b. Ensure the primary site server computer account has administrative privileges over the new site database server computer.
c. Close any open Configuration Manager console connections to the site server.
d. On the primary site server computer, use the hierarchy maintenance tool (Preinst.exe) to stop all site services with the following command: Preinst /stopsite.
e. On the primary site server computer, click Start, click All Programs, click Microsoft System Center, click Configuration Manager 2007, and click ConfigMgr Setup, or navigate to the .\bin\i386 directory of the Configuration Manager 2007 installation media and double-click Setup.exe.
f. Click Next on the Configuration Manager Setup Wizard Welcome page.
g. Click Perform site maintenance or reset this site on the Configuration Manager Setup Wizard Setup Options page.
h. Select Modify SQL Server configuration on the Configuration Manager Setup Wizard Site Maintenance page.
i. Enter the appropriate SQL Server name and instance (if applicable) for the new site database server as well as the site database name on the Configuration Manager Setup Wizard SQL Server Configuration page.
j. Configuration Manager Setup performs the SQL Server configuration process.
k. Restart the primary site server computer, and verify the site is functioning normally.
If you want to create Systems Management Server (SMS) 2003 or System Center Configuration Manager (ConfigMgr / SCCM) 2007, Container i.,e “System Management” with Power shell here it is the Cmdlts
# Get the distinguished name of the Active Directory domain
$DomainDn = ([adsi]"").distinguishedName
# Build distinguished name path of the System container
$SystemDn = "CN=System," + $DomainDn
# Retrieve a reference to the System container using the path we just built
$SysContainer = [adsi]"LDAP://$SystemDn"
# Create a new object inside the System container called System Management, of type "container"
$SysMgmtContainer = $SysContainer.Create("Container", "CN=System Management")
# Commit the new object to the Active Directory database
$SysMgmtContainer.SetInfo()
You’ll still have to set permissions appropriately, but if you’re looking to automate the entire process, here’s at least once piece!
To know what sites haven't backed up within a given date range (a day and a half since last backup), and those that have never backed up (never reported a backup).
Groovy stuff, not so easy to determine though, or so it would seem, unless you fall back entirely onto the Status Message sub-system.
When a SMS2003 or ConfigMgr backup completes, a Status Message is produced by the SMS_SITE_BACKUP component and processed by the Site server. As you probably know, Status Messages replicate up the hierarchy, so the Central Site server will know all Status Messages being "sent up".
I've had this code running for a few days, it seems to work a charm.
There is one thing that can get in the way though, customised Status Filter Rules. If you have them, you understand them (unless you've inherited in which case GIYF), and know that they can block Status Messages from being processed or delivered to the Parent Site server (drop all informational for example, as the last rule in the rule set, yes some folks do this!).
The T-SQL to bring back the Status Messages, and to render a list of machines that do not fit the logic (no backup reported, ever) is here:
SELECT vsite.ServerName AS Servername, vsite.SiteCode, MAX(stat.Time) AS LastTime
FROM vStatusMessages AS stat LEFT OUTER JOIN
StatusMessageInsStrs AS ins ON ins.RecordID = stat.RecordID LEFT OUTER JOIN
StatusMessageAttributes AS att1 ON att1.RecordID = stat.RecordID LEFT OUTER JOIN
v_Site AS vsite ON vsite.ServerName = stat.MachineName
WHERE (vsite.Type = 2) AND (stat.Component = 'SMS_SITE_BACKUP') AND (stat.MessageID = 5035)
GROUP BY vsite.ServerName, vsite.SiteCode
HAVING (MAX(stat.Time) < DATEADD(day, - 1.5 , GETDATE()))
ORDER BY LastTime
select 'Sites that have never reported a backup (Investigate any server that is listed)'
select servername from v_site where type = 2 and servername not in
(SELECT vsite.ServerName AS Servername
FROM vStatusMessages AS stat LEFT OUTER JOIN
StatusMessageInsStrs AS ins ON ins.RecordID = stat.RecordID LEFT OUTER JOIN
StatusMessageAttributes AS att1 ON att1.RecordID = stat.RecordID LEFT OUTER JOIN
v_Site AS vsite ON vsite.ServerName = stat.MachineName
WHERE (vsite.Type = 2) AND (stat.Component = 'SMS_SITE_BACKUP') AND (stat.MessageID = 5035)
GROUP BY vsite.ServerName, vsite.SiteCode
HAVING (MAX(stat.Time) >= DATEADD(day, - 1.5 , GETDATE())))
The Query itself is entirely harmless, in that it doesn't UPDATE or DELETE, but you should be aware it can put a load on your DB instance while running. Nothing to big to worry about, unless you are seriously underspec'd hardware-wise.
And finally, be aware that as long as Status Filter rules are not inhibiting the delivery of the Status Message from down-level sites up the hierarchy, and that Sites in your hierarchy are communicating with their Parent's correctly, then you should be OK to rely on this report. I would suggest having some more reports configured to check for any sites that haven't reported in within the last 24hrs (indicative of some kind of failure taking place) and also to look at using dedicated Monitoring tools such as OpMgr to monitor Site servers and Site systems health using the Management Pack.
I like SCCM (System Center Configuration Manager) and in my opinion it is a great management tool, but it's developers, apparently, forgot the small things that makes it better. One of the missing feathers is the copy & paste menu option ("Elementary my dear Watson"). When I first installed SCCM 2007, I was very excited to find the copy option, but till today I couldn't find his little sister, "paste", I suspect that they decided to release her in the next version.
Please help "Copy" find his little sister "Paste" in the following picture:
There is a saying "If the mountain won't come to Muhammad, Muhammad must go to the mountain.", so I tried to write something of my own. Microsoft delivers a good SDK pack for SCCM, which helped me reach my goal.
My tool adds Copy and Paste options to the context menu of Collections (Queries), Packages, Programs and Advertisements.
Collections (Collection Queries)
Select the source collection (from the right or left pane) and choose "Copy Collection Query"
Select target collection (from the right or left pane) and choose "Paste Collection Query"
Choose a name for the new query
If you press cancel the specific query will not be copied (It will proceed to the next query)
The result:
You first need to refresh the collection branch
At the end of the process you will be asked whether or not you want to delete the cashed settings
Packages
Select the source package and choose "Copy Package"
Works only from the right pane
To paste the new package select any package on the right pane, and choose "Paste Package" from the Popup menu
Choose a name for the new package
Choose whether or not you want to delete the cached settings
Don't forget to refresh the collection branch:
Distribution Points,Access Accounts,Programs won't be copied
Programs
Select the source package and choose "Copy Program"
Works only from the right pane
To paste the new program to the same package, right click the source program (on the right pane), and choose "Paste Program" from the menu
To paste the new program to another package, right click the target "Programs" (on the left pane), and choose "Paste Program" from the menu
Choose a name for the new program
Choose whether or not you want to delete the cached settings
Don't forget to refresh the Programs' branch:
Advertisements
Select the source package and choose "Copy Advertisement"
Works only from the right pane
To paste the new advertisement select any advertisement on the right pane, and choose "Paste Advertisement" from the menu
Choose a name for the new Advertisement
Choose whether or not you want to delete the cached settings
If the source advertisement contains custom scheduler it won't be copied, instead the new advertisement will contain the following fixed date as shown below (Of course, after pasting, you can change it to any desired date):
The purpose of this behavior is to avoid automatic deployment after pasting the new advertisement.
For this reason try to avoid copying advertisements which contains "AS Soon AS Possible"
The target mandatory assignments will have two assignments:
SETUP
During the setup you can choose which extension to install:
You can download the setup from HERE
msg.exe * /TIME:300 /v /w "Message From IT Administrator: Please Save and close your all office Applications and then click OK"
Time:300 seconds will wait for the user input if no input received it will execute it
Send a message to a user.
MSG {username | sessionname | sessionid | @filename | *}
[/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]
username Identifies the specified username.
sessionname The name of the session.
sessionid The ID of the session.
@filename Identifies a file containing a list of usernames,
sessionnames, and sessionids to send the message to.
* Send message to all sessions on specified server.
/SERVER:servername server to contact (default is current).
/TIME:seconds Time delay to wait for receiver to acknowledge msg.
/V Display information about actions being performed.
/W Wait for response from user, useful with /V.
message Message to send. If none specified, prompts for it
or reads from stdin.
Configuration Manager 2007 documentation library (http://technet.microsoft.com/en-us/library/bb680651.aspx) has been updated on the Web with updates for April. Topics that were updated have Updated: April 1, 2011 at the top of the topic.
Configuration Manager 2007 Quizzes also updated
Configuration Manager 2012 documentation library Configuration Manager 2012 Documentation Library.
---Single system required Patch’s report from SQL
SELECT DISTINCT
SYS.Name0
AS [Machine Name], UCS.Status AS [Patch Status Code],
CASE WHEN UCS.Status = '2' THEN 'Applicable' WHEN UCS.Status = '3' THEN 'Installed' ELSE '' END AS 'Patch Status', UI.BulletinID, UI.ArticleID,
UI.Title
FROM
v_R_System AS SYS LEFT OUTER
JOIN
v_Update_ComplianceStatusAll
AS UCS ON SYS.ResourceID = UCS.ResourceID INNER
JOIN
v_UpdateInfo
AS UI ON UCS.CI_ID = UI.CI_ID
WHERE
(UCS.Status IN ('3', '2')) AND (SYS.Name0 = 'ServerName'
)
run the below script to get the actual system state. this will help to report back actual compliance of patch level to SCCM Server
Option Explicit
On Error Resume Next
Call RefreshServerComplianceState
' WScript.Echo "Finished"
Sub RefreshServerComplianceState()
' Initialize the UpdatesStore variable.
dim newCCMUpdatesStore
' Create the COM object.
set newCCMUpdatesStore = CreateObject ("Microsoft.CCM.UpdatesStore")
' Refresh the server compliance state by running the RefreshServerComplianceState method.
newCCMUpdatesStore.RefreshServerComplianceState
' Output success message.
' wscript.echo "Ran RefreshServerComplianceState."
End Sub
How to read the advertisement reports:-
Accepted – Software can be installed in few mins, as it will start downloading the software from remote /local system
No Status - Systems are not online or has issue with SMS Agent, or not received the policy, if the system is online then this status must change in one hour time (if the status not changed then you may
Suspect the issue with SMS / SCCM agent )
Accepted - No Further Status – Back end installation may be running and need to wait for some time to get the actual status
Failed – Software installation failed, you need to re push once again this advertisement.
Succeeded – Software installed successfully without any issues
Check with these commands
BITSADMIN /LIST /ALLUSERS
C:\>BITSADMIN /geterror {7D46DE5B-3911-40B1-A72B-607737DB06F9}
BITSADMIN version 2.0 [ 6.6.3790.3959 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.
ERROR FILE: http://sccmserver.mydomain:80/SMS_DP_SMSPKGD$/SMSPKG/HCC00
05F/AdminImage/x86/en-us/acad/Acad/Program Files/Root/HelpHtml/contexthelp/+CONSTRAINTSETTINGS.htm -> C:\WINDOWS\system32\CCM\Cache\HCC0005F.1.System\AdminImage/x86/en-us/acad/Acad/Program Files/Root/HelpHtml/contexthelp/+CONSTRAINTSETTINGS.htm
ERROR CODE: 0x80190194 - The requested URL is not found on this server.
ERROR CONTEXT: 0x00000005 - When processing the remote file error has occurred
/LISTFILES job Lists the files in the job
/SUSPEND job Suspends the job
/RESUME job Resumes the job
/CANCEL job Cancels the job
/COMPLETE job Completes the job
BITSADMIN /INFO job [/VERBOSE]
BITSADMIN /geterror {B2826EF6-C78B-4D1C-A386-94D0D36DC107}
BITSADMIN /LIST /ALLUSERS
Where job =
{B2826EF6-C78B-4D1C-A386-94D0D36DC107}By accessing this Website, you indicate your acknowledgement acceptance of the following terms and conditions. These terms and conditions may change from time to time, and you agree to be bound by any such changes when posted on this Website, including its affiliates, as applicable reserves all of its rights at law and equity, The information and content displayed on this Website, including but not limited to text, graphics, logos, images, audio clips and software, is the property of Public or its licensors, as the case may be, and is protected by copyright laws. While I invite you to browse, no content or information on this Website may be downloaded, reproduced or modified in any manner without the prior written consent of me (PaddyMaddy) or as otherwise expressly provided herein.