Tuesday, October 27, 2015

Installing Multiple Software Updates(.msu) with SCCM using AutoIT Script


Installing Multiple Software Updates(.msu) with SCCM using AutoIT Script

Used below sample AutoIT script for installing Microsoft updates @ SCCM. Created an application, deployment type as script.

//
Opt("TrayIconHide", 1)
ShellExecuteWait("wusa.exe", "/quiet /norestart Windows6.1-KB3083710-x86.msu", "", "", @SW_HIDE)
ShellExecuteWait("wusa.exe", "/quiet /norestart Windows6.1-KB3088195-x86.msu-MS15-111.msu", "", "", @SW_HIDE)
ShellExecuteWait("wusa.exe", "/quiet /norestart IE11-Windows6.1-KB3093983-x86-ms15-106.msu", "", "", @SW_HIDE)
RegWrite("HKEY_LOCAL_MACHINE\Software\abc", "abc", "REG_SZ", "1")---for detection Method
Exit

//


Wednesday, September 30, 2015

AutoIT Sample scripts- for SCCM Packaging


AutoIT Sample scripts 


//Hide tray Icon

Opt("TrayIconHide", 1)

// Add Registry Value

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\ABC", "abc", "REG_DWORD", "0")

// For Sleep/Wait/Pause time

Sleep(60000)

// Running a program .msi or .exe with switches

RunWait("msiexec /i abc.msi ALLUSERS=1 /qn /norestart")

// For registry file or .exe/.msi

ShellExecuteWait("Regedit.exe", "/s abc.reg", "", "", @SW_HIDE)


Sample Script

Opt("TrayIconHide", 1)
RunWait("msiexec /i abc.msi ALLUSERS=1 /qn /norestart")
Sleep(60000)
ShellExecuteWait("Regedit.exe", "/s abc.reg", "", "", @SW_HIDE)
RunWait("abc.bat")
Exit


More Details about AutoIT - https://www.autoitscript.com/site/autoit/

Friday, September 25, 2015

Packaging Enterprise version(x86 & x64) Google Chrome with AutoIT

Packaging Enterprise version Google Chrome with AutoIT

Download Latest version on Chrome Emterprise version.

Create a directory and copy files and create an application in SCCM 2012

1. Chrome msi
2. Install.cmd
3.master_preferences

Please downloaded the file and instaruction from here

install.cmd

msiexec /qn /norestart /i "%~dp0chromeEnterprise44.0.2403.107_x64.msi"
if exist "c:\Program Files\Google\Chrome\Application\master_preferences" copy /y "%~dp0master_preferences" "C:\Program Files\Google\Chrome\Application\master_preferences"
if exist "c:\Program Files (x86)\Google\Chrome\Application\master_preferences" copy /y "%~dp0master_preferences" "C:\Program Files (x86)\Google\Chrome\Application\master_preferences"
reg add HKLM\Software\Policies\Google\Update /f /v AutoUpdateCheckPeriodMinutes /d 0
sc stop gupdate
sc config gupdate start= disabled
sc stop gupdatem
sc config gupdatem start= disabled
del "C:\Program Files\Google\Update\GoogleUpdate.exe"
rmdir /s /q "C:\Program Files\Google\Update"
REM Return exit code to SCCM
exit /B %EXIT_CODE%


Sample master_preferences
{ 
"homepage" : "http://msiworld.blogspot.com", 
"homepage_is_newtabpage" : false, 
"browser" : { 
"show_home_button" : true,
 "check_default_browser" : false,
 "window_placement": {
 "bottom": 1000,
 "left": 10,
 "maximized": false,
 "right": 904,
 "top": 10,
 "work_area_bottom": 1010,
 "work_area_left": 0,
 "work_area_right": 1680,
 "work_area_top": 0
 }
 },
 "bookmark_bar" : { 
"show_on_all_tabs" : true 
}, 
"distribution" : { 
"skip_first_run_ui" : true, 
"show_welcome_page" : false, 
"import_search_engine" : false, 
"import_history" : false, 
"create_all_shortcuts" : true, 
"do_not_launch_chrome" : true, 
"make_chrome_default" : false 
}
}

Edit the chrome msi file name as appropriate in .bat. This should also disable auto update but i had issues with disabling auto update using batch so i have created an AutoIT script to make it work every single time it runs- SCCM 2012 R2.

Details about AutoIT


Create a AutoIT Script and compile it. Create an Application in SCCM 2012 using Script and deploy it.

Opt("TrayIconHide", 1)
RunWait( "install.cmd")
RunWait(@ComSpec & " /c " & "taskkill /f /im GoogleUpdate.exe ", "", @SW_HIDE)
$svccfg = "sc config gupdate start= disabled"
RunWait(@ComSpec & " /C " & $svccfg, "", @SW_HIDE)
$svccfg = "sc config gupdatem start= disabled"
RunWait(@ComSpec & " /C " & $svccfg, "", @SW_HIDE)
FileDelete("C:\Program Files\Google\Update\GoogleUpdate.exe")
FileDelete("C:\Program Files\Google\Update\GoogleUpdate.exe")
Exit

Create a packages for x86 & x64 bit. Create an application in SCCM 2012 and choose deployment Type option. Create a Global condition based on Architecture type for X86 & x64 and select Global condition requirement.

When application will be deployed , it will check if the OS is 64 bit, then 64 bit Google chrome will be installed on the system and accordingly for x86.






SCCM 2012 Dynamic collection for Specific System Model - Lenovo Laptops

SCCM 2012 Dynamic collection for Specific System Model - Lenovo Laptops

If you need to create a collection for specic System model for Lenovo Laptops. Please use below query and change Model accordingly.


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_COMPUTER_SYSTEM_PRODUCT on SMS_G_System_COMPUTER_SYSTEM_PRODUCT.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM_PRODUCT.Version = "ThinkPad x240"

Monday, June 29, 2015

SCCM 2012 Reports for installed Software(Inventory)

SCCM 2012 Reports for installed Software(Inventory)

This is sample report for MS Project

SELECT DISTINCT
                         sys.Netbios_Name0 AS [Computer Name], sys.User_Domain0 AS [Domain Name], sys.User_Name0 AS [User Name], sys.Operating_System_Name_and0 AS OS, arp.DisplayName0 AS [Software Name],
                         arp.Version0 AS [Version Number]
FROM            dbo.v_R_System AS sys INNER JOIN
                         dbo.v_Add_Remove_Programs AS arp ON sys.ResourceID = arp.ResourceID
WHERE        (arp.DisplayName0 LIKE N'%Project%') AND (NOT (arp.DisplayName0 LIKE N'%Security Update%')) AND (NOT (arp.DisplayName0 LIKE N'Hotfix%')) AND (NOT (arp.DisplayName0 LIKE N'Update for Microsoft%'))
                         AND (NOT (arp.DisplayName0 LIKE N'Microsoft Project MUI%')) AND (NOT (arp.DisplayName0 LIKE N'Microsoft Office Project MUI%')) AND (NOT (arp.DisplayName0 LIKE N'%Update For Windows%'))

Wednesday, June 24, 2015

SCCM 2012 R2 - Collection Query for IE 11 installed Computers

SCCM 2012 R2 - Collection Query for IE 11 installed Computers


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_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceID inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceID where SMS_G_System_SoftwareFile.FilePath like "%\\Program Files\\Internet Explorer\\" and SMS_G_System_SoftwareFile.FileName like "iexplore.exe" and SMS_G_System_SoftwareFile.FileVersion like "11.%"


Friday, April 17, 2015

SCCM 2012 List of Websites required for Software Update(SUP) Sync


SCCM 2012 List of Websites required for Software Update(SUP) Sync: Below sites are required to be allowed from Firewall to Sync with Microsoft Update.

If your organization does not allow the ports and protocols to be open to all addresses on the firewall between the active software update point and the Internet, you can restrict access to the following domains, so that WSUS and Automatic Updates can communicate with Microsoft Update: