myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


On-demand patching in SCCM

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> On-demand patching in SCCM Page: [1]
Login
Message << Older Topic   Newer Topic >>
On-demand patching in SCCM - 9/11/2008 1:25:51 PM   
rdiekhoff

 

Posts: 13
Score: 2
Joined: 7/9/2004
Status: offline
Does anyone have a solution for SCCM similar to the one described here (http://www.myitforum.com/articles/8/view.asp?id=8909) for SMS 2003?  

Thanks!
Rhonda
Post #: 1
RE: On-demand patching in SCCM - 9/11/2008 1:36:02 PM   
hcortez463


Posts: 780
Score: 62
Joined: 4/8/2005
Status: offline
on demand intall? 

_____________________________

If it Helps, Please rate....

(in reply to rdiekhoff)
Post #: 2
RE: On-demand patching in SCCM - 9/11/2008 1:39:59 PM   
rdiekhoff

 

Posts: 13
Score: 2
Joined: 7/9/2004
Status: offline
Yes, on-demand installation of patches.  In SMS 2003, we currently deploy patches to all systems via advertisements using the ITMU tools, but we also allow the users to install patches on-demand using the script that is listed in my origianl post.  We're preparing to upgrade to SCCM 2007 and I was wondering if there is a similar script or method of allowing users to install patching on-demand from the SCCM SUPs.

Rhonda

(in reply to hcortez463)
Post #: 3
RE: On-demand patching in SCCM - 9/11/2008 1:58:11 PM   
hcortez463


Posts: 780
Score: 62
Joined: 4/8/2005
Status: offline
In ITMU do you make the patches manditory?

_____________________________

If it Helps, Please rate....

(in reply to rdiekhoff)
Post #: 4
RE: On-demand patching in SCCM - 9/11/2008 2:03:14 PM   
rdiekhoff

 

Posts: 13
Score: 2
Joined: 7/9/2004
Status: offline
Yes, we do but we still like to give the users the opportunity to install them on-demand.  We also use the script I referred to during the installation of new PCs (we don't use OSD - we have an in-house solution for PC provisioning).

(in reply to hcortez463)
Post #: 5
RE: On-demand patching in SCCM - 9/11/2008 2:07:01 PM   
hcortez463


Posts: 780
Score: 62
Joined: 4/8/2005
Status: offline
i see.. im sorry if im missunderstanding you but in SCCM you can allow the user to install apps any time or schedule.. Check out these examplese by John. 

http://www.myitforum.com/articles/20/view.asp?id=11241

http://www.myitforum.com/articles/20/view.asp?id=11242

_____________________________

If it Helps, Please rate....

(in reply to rdiekhoff)
Post #: 6
RE: On-demand patching in SCCM - 9/11/2008 3:35:18 PM   
ssign

 

Posts: 5
Score: 0
Joined: 7/29/2008
Status: offline
 (http://www.myitforum.com/articles/8/view.asp?id=8909)

I downloaded and changed the ServerName and File location in the .cmd file and didn't have to do anything to the vbscript. It worked the first time! I was trying to do this on my own yesterday and I thank the creator becuase I didn't even come close!

*Note* I am running SMS 2003, I have already created my patch collection using sms. I put the files in the root of the folder containing all my patches. I have computers that are not reachable by our SiteServer. Now I can run the same updates on these standalone computers.

(in reply to hcortez463)
Post #: 7
RE: On-demand patching in SCCM - 9/12/2008 8:39:19 AM   
rdiekhoff

 

Posts: 13
Score: 2
Joined: 7/9/2004
Status: offline
Thanks for the examples hcortez463 - those documents will probably come in handy while trying to show others what options we have, and will keep me from having to create these from scratch. 
 
However, I'm still hoping that someone has a similar solution for SCCM as what was posted for SMS 2003 at http://www.myitforum.com/articles/8/view.asp?id=8909)   This script works great in SMS 2003 and it would be fantastic if we had one like it in SCCM.  If anyone knows of a solution to allow users to install patches from an SCCM SUP "on-demand", please consider sharing it!  THANKS!
 
 

(in reply to ssign)
Post #: 8
RE: On-demand patching in SCCM - 9/12/2008 12:34:44 PM   
wbracken


Posts: 1036
Score: 22
Joined: 4/12/2002
From: St. Louis
Status: offline
I think you may mean something like this?  The attached code will download if needed and install any approved patches.  Since SCCM uses WSUS it should work the same.  this runs silently and forces a reboot if needed but you could modify as needed.

on error resume next
'######################################################################
'# Initialize
'######################################################################
Const FORCEDRESTART = 6
Const HKEY_LOCAL_MACHINE = &H80000002
Dim updateSession, updateSearcher, updatesToDownload, updatesToInstall
Dim objReg, strKeyPath, strValueName, regWSUSServer
Dim updateServerIsOnline
Dim objHttpRequest
Dim searchResult
Dim update
Dim downloader
Dim I
Dim installer
Dim installationResult
Dim computerName
Dim objShell, objWMIService, colOperatingSystems, objOperatingSystem,objnetwork
Dim strEventText
Dim EmailAddresses
Dim EmailMessage
computerName = "."
strEventText = ""
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
Set objShell = Wscript.CreateObject("Wscript.Shell")
set objnetwork=wscript.createobject("wscript.network")
'######################################################################
'#Begin Installation Process
'######################################################################
objShell.LogEvent 4, "WUSUS has been initiated."

'######################################################################
'# Verify the availability of our Updates server (i.e. WSUS or Windows Update)
'######################################################################
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
 computerName & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
strValueName = "WUServer"
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,regWSUSServer

Set objHttpRequest = CreateObject("Msxml2.XMLHTTP")
objHttpRequest.open "HEAD", regWSUSServer, False

objHttpRequest.send
If Err.Number <> 0 Then
 updateServerIsOnline = false
 objShell.LogEvent 2, "The WSUS Server, " & regWSUSServer &_
 " is not available, Terminating forced install."
 wscript.quit
Else
 updateServerIsOnline = true
End If

'######################################################################
'# Search for available updates and notify the Application Event Log
'######################################################################
updateSearcher.Online = updateServerIsOnline
Set searchResult = _
updateSearcher.Search("IsInstalled=0 and IsAssigned=1")
If searchResult.Updates.Count = 0 Then
 ' There are no applicable updates
 objShell.LogEvent 2, "No updates to install. Script terminated."
 
 
 WScript.Quit
End If
strEventText = "The following updates will be installed:" & vbCRLF
For I = 0 To searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    strEventText = strEventText & vbTab & I + 1 & "> " & update.Title & vbCRLF
Next

strEventText = strEventText & vbCRLF & "Proceeding with download and installation...." & vbCRLF
objShell.LogEvent 4, strEventText
'######################################################################
'# Search for updates that still need to be downloaded and download them
'######################################################################
If updateServerIsOnline Then 'Check to make sure we are in online mode first

 Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
 strEventText = "Downloading the following updates:" & vbCRLF
 For I = 0 to searchResult.Updates.Count-1
     Set update = searchResult.Updates.Item(I)
     If update.IsDownloaded = False Then
  strEventText = strEventText & vbCRLF & I + 1 & "> " & update.Title 
  updatesToDownload.Add(update)
     End If
 Next
 If updatesToDownload.Count < 1 Then
  'Do Nothing
 Else
  objShell.LogEvent 4, strEventText
  Set downloader = updateSession.CreateUpdateDownloader() 
  downloader.Updates = updatesToDownload
  downloader.Download()
 End If
End If
'######################################################################
'# Create collection of downloaded updates to install
'######################################################################
For I = 0 To searchResult.Updates.Count-1
    set update = searchResult.Updates.Item(I)
    If update.IsDownloaded = true Then
       updatesToInstall.Add(update) 
    End If
Next
'######################################################################
'# Install updates
'######################################################################
Set installer = updateSession.CreateUpdateInstaller()
installer.Updates = updatesToInstall
Set installationResult = installer.Install()

For I = 0 To searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
Next
If installationResult.RebootRequired = true Then
 objShell.LogEvent 4, "Completed the installation of updates.  Restarting Windows..."
 
 'Open a WMIService connection to the local machine
 Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
  computerName & "\root\cimv2")
 'Obtain the local OS Collection
 Set colOperatingSystems = objWMIService.ExecQuery _
     ("Select * from Win32_OperatingSystem")
 'Use the Win32Shutdown method to force the restart
 For Each objOperatingSystem in colOperatingSystems
     objOperatingSystem.Win32Shutdown(FORCEDRESTART)
 Next
Else
 objShell.LogEvent 4, "Completed the installation of updates.  No restart is required."
 
 
End If




_____________________________

William Bracken

Visit my new Blog
http://wbracken.wordpress.com/

(in reply to rdiekhoff)
Post #: 9
RE: On-demand patching in SCCM - 9/16/2008 8:03:46 AM   
rdiekhoff

 

Posts: 13
Score: 2
Joined: 7/9/2004
Status: offline
Thanks wbracken.  I will see if I can get this to work for us!

Rhonda

(in reply to wbracken)
Post #: 10
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> On-demand patching in SCCM Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.279