Thursday, February 26, 2009

SCCM Duplicate System Entries in the Console

SCCM Duplicate System Entries in the Console

If your SCCM console has duplicated System entries in the Console, and you want to find it right? Below is the Query for this issue.


select R.ResourceID,R.ResourceType,R.Name,R.SMSUniqueIdentifier,R.ResourceDomainORWorkgroup,R.Client from SMS_R_System as r full join SMS_R_System as s1 on s1.ResourceId = r.ResourceId full join SMS_R_System as s2 on s2.Name = s1.Name where s1.Name = s2.Name and s1.ResourceId != s2.ResourceId

I love this Query, especially.


Tuesday, February 24, 2009

SMS/SCCM Command-line Actions - alternate to right click tools ?

SMS/SCCM Command-line Actions

We can use WMIC tool to run on remote computers and get the client actions as we want

Some examples to trigger SMS/SCCM Client Actions from command line:

Disable Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig  CREATE ComponentName="Disable SWDist",Enabled="false",LockSettings="TRUE",PolicySource="local",PolicyVersion="1.0" ,SiteSettingsKey="1" /NOINTERACTIVE

Re-Activate Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig  WHERE ComponentName="Disable SWDist" delete /NOINTERACTIVE

Trigger Hardware Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}" /NOINTERACTIVE

Trigger Software Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000002}" /NOINTERACTIVE

Trigger DataDiscoverRecord (DDR) update:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000003}" /NOINTERACTIVE

Force a FULL HW Inventory on next HW-Inv Schedule:
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID="{00000000-0000-0000-0000-000000000001}" DELETE /NOINTERACTIVE

Repair SMS/SCCM Agent on a remote client:
WMIC /node:%MACHINE% /namespace:\\root\ccm path sms_client CALL RepairClient

Repair a list (all clients listed in clients.txt) of remote SMS/SCCM Agents:
WMIC /node:@clients.txt /namespace:\\root\ccm path sms_client CALL RepairClient


VB Script Drive Space Check on list of System

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
intRow = 2
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "Drive"
objExcel.Cells(1, 3).Value = "Total Size"
objExcel.Cells(1, 4).Value = "Used Space"
objExcel.Cells(1, 5).Value = "Free Space"
objExcel.Cells(1, 6).Value = "Free Space Percentage"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("MachineList.txt", 1)
Do Until objFile.AtEndOfStream
strComputer = objFile.ReadLine
Set objWMIService = GetObject("winmgmts://" & strComputer)
On Error Resume Next
Set colDisks = objWMIService.ExecQuery("Select * From Win32_LogicalDisk Where DriveType = 3")
For Each objDisk In colDisks
objExcel.Cells(intRow, 1).Value = Ucase(strComputer)
objExcel.Cells(intRow, 2).Value = objDisk.DeviceID
objExcel.Cells(intRow, 3).Value = (FormatNumber(objDisk.Size/ 1024^3, 1)) & " GB"
objExcel.Cells(intRow, 4).Value = (FormatNumber(objDisk.Size/ 1024^3, 1) - FormatNumber(objDisk.FreeSpace/ 1024^3, 1)) & " GB"
objExcel.Cells(intRow, 5).Value = (FormatNumber(objDisk.FreeSpace/ 1024^3, 1)) & " GB"
objExcel.Cells(intRow, 6).Value = FormatPercent(objDisk.FreeSpace/objDisk.Size, 0)
If FormatPercent(objDisk.FreeSpace/objDisk.Size, 0) <= "25%" Then
objExcel.Cells(intRow, 6).Font.ColorIndex = 3
End If
intRow = intRow + 1
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
MsgBox "Done"


Friday, February 20, 2009

WQL to SQL Query

Want to see What is the query????????
This SQL Query can be used to see how WQL is converted to SQL by SMS for collections












Collections,Collection_Rules, Collection_Rules_SQL



.CollectionID = Collection_Rules.CollectionID


Collections.CollectionID = Collection_Rules_SQL.CollectionID-------------------

Monday, February 16, 2009

SCCM 2007 Right Click Tools latest version available, one can download from the below link

SCCM 2007 Right Click Tools latest version available, one can download from the below link
All the advantages from the above link are below( actual source is above link)

1.       Most of the tools that were included in the original SMS Console Additions V1.4

2.       The ability to see the computer details and security compliance web reports for a single client inside collections

3.       A separate drill down for client logs as well as security update client logs.

4.       The ability to check the status of an advertisement with a right click from that advertisement In order to get the client and the advertisement web reports to work you must perform the following.

5.       Fixed the right click tools on the "collections" that didn't open a CMD window when running. Also fixed the echo so the results now show up in a command window

6.        Will detect the version of the tool installed so re-installation of unnecessary files does not occur when new versions are released

7.        Now has an entry in Add Remove Programs which enables un-installation of the program

8.       No more hard coding of your site code to get scripts and reports to run correctly

  1. Detects and uninstalls any previous versions of the tool.
  2. Right click tool added to the software updates node, but it only works if there is a update list with patches deployed. 
  3. Prefixed each tool with your SCCM site code for easier recognition
  4. Right click ability on each advertisement that will display three web reports
  5. Added a prompt to see the CCMsetup.log on the SCCM Client install
  6. Fixed the Client Action for User Policy Evaluation and Update
  1. Added all the client actions from the control panel including the Security Updates Scan and Security Updates Deployment Evaluation
  2. Added an extension to the client tools that will tell you what collection a user or system belongs to.
  3. Added a web report to show all the advertisements for a certain system.
  1. CCM and CCMSetup directories now work properly.
  1. Added the Software Updates Scan Cycle to the Collection root so it runs not just on one client but a whole collection.  Requested by a member from the forum community.
  2. Added Support for Windows 2008 64bit.
  3. New Tool to Re-run advertisements from a drop down list.
  4. Added the ability to run client actions from the Query results.
  5. Fixed issue with script.bat


Thursday, February 12, 2009

SCCM How to make know to unknow

select * from dbo.Network_DATA Where MACAddress0 = '00:21:70:39:a2:b7'
select * from system_disc where Name0 = 'Machine Name'
then change it to delete
Will post more on this....

SCCM OSD Error code 80004005

Tasksequence Issue:

In Build and Captured error "Task Sequence Manager could not resume SMS components. code 80004005 TSManager 2/12/2009 12:15:04 AM 1268 (0x04F4)"

Resolution 1:- Make sure in Task Sequese you have joining to Workgroup. Because sysprep can not be make under joining into domain
Resolution 2:- Check your Network desgin if it is build with Cisco then might be Fast Port opened need to stop this to fix it.. Yep I never find this information microsoft site (I ver bad in searching )but this is the solution What i found.


Monday, February 9, 2009

VBSCRIPT For a Copy a Folder

For a Copy a Folder

Dim wShell
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
'errReturn = objWMIService.Create _
' ("cmd.exe /c md c:\ups", Null, Null, intProcessID)
Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.CopyFolder "file:// 2008\*.*" , "c:\pav\" , OverwriteExisting

Set wShell = CreateObject("WScript.Shell")
'wShell.Run "c:\ups\Election.html"
Const OverwriteExisting = TRUE

Friday, February 6, 2009

Patch Failed to scan and install Error 8024400E

Windows Update: Patch Management Error 8024400E  in the log file:
If you find 8024400E  error in the patching failing system that means patchs are not approved. Approve it in the update list.


Thursday, February 5, 2009

vb script To Clear SCCM / SMS CCM / Cache Folder

To Clear SCCM / SMS CCM / Cache Folder
' Script to Clear SMS cache files
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"
end if
set oCache=oUIResManager.GetCacheInfo()
if oCache is nothing then
     set oUIResManager=nothing
'      wscript.echo "Couldn't get cache info - quitting"
end if
set oCacheElements=oCache.GetCacheElements
'wscript.echo "There are " & oCacheElements.Count & " cache elements"
' ***** Begin CLEAR CACHE *****
for each oCacheElement in oCacheElements
' ***** End CLEAR CACHE *****
' ***** Clean up *****
set oCacheElements=nothing
set oUIResManager=nothing
set oCache=nothing


Change Default Power Management settings on Laptop users

Change Default Power Management settings on Laptop users to utilize batarry save
@echo off
powercfg /change "Portable/Laptop" /standby-timeout-ac 30 /standby-timeout-dc 30 /hibernate-timeout-ac 45 /hibernate-timeout-dc 45
powercfg /setactive "Portable/Laptop"


Change Default Power Management settings

To Change Default Power Management settings  to your own settings that is to allway On:--
@echo off
powercfg /change "Always On" /monitor-timeout-ac 30 /monitor-timeout-dc 30 /standby-timeout-ac 30
/standby-timeout-dc 0 /hibernate off
powercfg /setactive "Always On"

Wednesday, February 4, 2009

SCCM Query for SCCM Clients Model and Manufactures Name

Need to extract SCCM Clients Model and Manufactures Name?
You have to dig the Computer_System_DATA Table. Here are two shared SQL Querys.

Select DISTINCT Model0 from Computer_System_DATA

The above one will show all the Models

The below Query will show everything in the Database


* from Computer_system_data


Tuesday, February 3, 2009

Use a PSEXEC tool to deploy software on list of systems in text file

Use a PSEXEC tool to deploy software on list of systems in text file
psexec @systems.txt -c exefilname.exe /silient commands