Monday, January 24, 2011

How to disable the Open file Security warning

I come across this error fairly regularly when coding for SCCM.. and mostly when using VBscript.

I found this KB is the best solution without having to disable it entirely.

http://support.microsoft.com/kb/889815


Power Management in SCCM R3

Microsoft Systems Center guest blog:
http://blogs.technet.com/b/systemcenter/archive/2011/01/20/guest-blog-how-power-consumption-and-cost-calculations-work-in-configuration-manager-2007-r3.aspx

http://blogs.technet.com/b/systemcenter/archive/2010/09/20/mvp-guest-blog-how-to-save-money-with-configmgr-2007-r3-and-feel-good-about-it.aspx

http://technet.microsoft.com/en-us/library/gg398008.aspx

Joining two or more collections into a new collection

Use the below code to create a new SCCM 'Collection' using the members of other one or more other collections.

- Create new collection
- Use a 'Query' to define the Membership Rules
- Use system resources
- Use the below SQL code to define the members.

Change the XXXXXXX to the Collection ID you want.

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 where SMS_R_System.ResourceId in (select ResourceId from SMS_CM_RES_COLL_XXXXXXX) or SMS_R_System.ResourceId in (select ResourceId from SMS_CM_RES_COLL_XXXXXXX)

Boom! your new collection is now populated with the members of other collections.

Tuesday, January 04, 2011

SCCM Collection based on 'File' and version less than "X"

The below System query shows "X.exe" file with anything less than version "X.x.x.x.". Very useful for discovering out of date files and creating and advertisement to install the correct version

Make sure you have your file inventory configured correctly.


SELECT        VRS.ResourceID, VRS.ResourceType, VRS.Name0

FROM            dbo.v_R_System AS VRS INNER JOIN
                         dbo.v_GS_SoftwareFile AS SF ON VRS.ResourceID = SF.ResourceID

 WHERE        SF.FileName = 'X.exe' AND SF.FileVersion <= 'x.x.x.x'
Please note i've used 'less than or equal to' in the above query if you want just less than remove the '='

Also a different way to do the same. Create 2 queries

http://www.sccm-tools.com/tools/wqlqueries/WQLQueries-Colcompswithfile.html

Thursday, November 25, 2010

VB Script to run gpupdate.exe /force silently without a reboot

If you use Gpupdate.exe /force in your logon scripts ypu would've of found by now that sometimes if not most often when running gpupdate.exe you are asked to either logoff or reboot to apply configuration settings. You've also probably found that there is no exact command like 'Gpupdate.exe /Force /Silent.'

The below VBscript below will run Gpupdate.exe /force without any user interaction it will also not show any log off or reboot requests.

To implement this in a logon script place the code below into its own SilentGPupdate.vbs file. Then call it from your logon script, I've set the WshShell.Run not to wait to finish each command because gpupdate.exe can run in its own space and time (doing this will keep your login times quick).

===============
'VB Script for Refreshing GroupPolicy Settings silently
'Script Version: 0.2
'Created: 25/11/2010
'Created By: Joejoeinc.com

'Define Variables and Objects.
Set WshShell = CreateObject("Wscript.Shell")

'Note: Gpupdate command has to be run twice as the ECHO command can't answer more than one question.

'Refresh the USER policies and also answer no to logoff if asked.
Result = WshShell.Run("cmd /c echo n | gpupdate /target:user /force",0,true)

'Refresh the Computer policies and answer no to reboot.
Result = WshShell.Run("cmd /c echo n | gpupdate /target:computer /force",0,true)

'Hand back the errorlevel
Wscript.Quit(Result)
===============

Props to Craig for pointing out that if you name the script gpupdate.vbs you will cause a loop.

Wednesday, November 24, 2010

General BITS troubleshooting

Iboyd has a great writeup on how and where to check various BITS settings in SCCM.

http://iboyd.net/index.php/2009/01/09/troubleshooting-sccm-and-bits-downloads/

One line in his post rings very true
"With BITS, you have to remember that, in simple terms, you’re downloading files from an over-glorified website. That means that your file transfers are dependent on the IIS instance running on the distribution point."