lunes, 19 de diciembre de 2011

Algunos reportes interesantes para SCCM

Hola!

Reportes!!! Seguramente tengan algunos reportes que utilicen bastante y que les sirven como base para crear otros reportes rápidamente.

Les dejo algunos bastantes interesantes
  • Información de espacio en disco de servidores:
SELECT SYS.Name,LDISK.DeviceID0, LDISK.Description0,
v_GS_COMPUTER_SYSTEM.Manufacturer0 as [Fabricante],
LDISK.VolumeName0 as [Nombre del disco],
LDISK.FreeSpace0 as [Espacio Libre (MB)],
LDISK.FreeSpace0/1024 as [Espacio Libre(GB)],
LDISK.Size0/1024 as [Total de espacio (GB)],
LDISK.FreeSpace0*100/LDISK.Size0 as C074

FROM v_FullCollectionMembership SYS
join v_GS_LOGICAL_DISK LDISK on SYS.ResourceID = LDISK.ResourceID
JOIN v_R_System RSYS ON SYS.ResourceID = RSYS.ResourceID
join v_GS_COMPUTER_SYSTEM on v_GS_COMPUTER_SYSTEM.ResourceID = RSYS.ResourceID

WHERE
LDISK.Size0 > 0
AND SYS.CollectionID = 'SMS000DS'
ORDER BY SYS.Name, LDISK.DeviceID0

  • Listar las colecciones a las que pertenece una máquina:
select  v_GS_COMPUTER_SYSTEM.Name0, v_Collection.Name,
v_FullCollectionMembership.CollectionID

from v_FullCollectionMembership inner join v_GS_COMPUTER_SYSTEM on v_FullCollectionMembership.ResourceID = v_GS_COMPUTER_SYSTEM.ResourceID join v_Collection on v_Collection.CollectionID = v_FullCollectionMembership.CollectionID
where v_GS_COMPUTER_SYSTEM.Name0 = @computer
  • Servidores con mas de 7 días sin reiniciarce:
SELECT     TOP (100) PERCENT dbo.v_R_System.Name0, dbo.v_GS_OPERATING_SYSTEM.LastBootUpTime0, DATEDIFF(Day,
                      dbo.v_GS_OPERATING_SYSTEM.LastBootUpTime0, GETDATE()) AS [Días desde el ultimo reboot], dbo.v_GS_OPERATING_SYSTEM.Caption0
FROM         dbo.v_GS_OPERATING_SYSTEM INNER JOIN
                      dbo.v_R_System ON dbo.v_GS_OPERATING_SYSTEM.ResourceID = dbo.v_R_System.ResourceID
WHERE     (DATEDIFF(Day, dbo.v_GS_OPERATING_SYSTEM.LastBootUpTime0, GETDATE()) > 7)
ORDER BY [Días desde el ultimo reboot]


(cambiar el GETDATE()) > 7 por el numero de días que deseen)
  • Informa de las máquinas que no tienen un archivo y pertenece a una colección en particular
Este informe les servirá de base para reportes donde se tiene que saber que servidores NO tienen algo y cuales son los joins que se deben utilizar para preguntar por el nombre de una colección. NOTA: para que puedan hacer esta consulta deberán activar el inventario de software y configurar que se busque el archivo que deseamos.

Select distinct
 v_R_System.Netbios_Name0 as [Servidor sin ARCHIVO.TXT],
 v_R_System.Operating_System_Name_and0 as [Sistema Operativo]

FROM v_R_System
 inner join v_FullCollectionMembership ON v_FullCollectionMembership.ResourceID = v_R_System.ResourceID
 inner join v_Collection ON v_Collection.CollectionID = v_FullCollectionMembership.CollectionID
 WHERE
  v_R_System.Netbios_Name0 not in
   (

   select v_r_system.Netbios_Name0
    from
     v_GS_SoftwareFile inner join v_r_system on v_r_system.resourceid=v_GS_SoftwareFile.resourceid
    where
     v_GS_SoftwareFile.filename like 'ARCHIVO.TXT'
   )

AND
v_Collection.Name like 'Servidores que deben tener el Archivo.txt'

order by v_R_System.Netbios_Name0

No duden en consultarme por algún otro ejemplo u otro tema!

Gastón!

viernes, 16 de diciembre de 2011

Herramientas imprescindibles para administrar SCCM

Hola nuevamente.

En estas últimas entradas les acerqué varias herramientas de utilidad para cualquiera que administre una plataforma de SCCM.

En este les incluyo 2 herramientas excelentes, infaltables!

SMS Client Control Tool http://sourceforge.net/projects/smsclictr/
Ideal para contralar los agentes de SMS/SCCM, incluye funciones como forzar inventarios, controlar despliegues de aplicaciones, ver ventanas de mantenimiento, reparar el agente, resetear políticas de agente, etc etc...

SCCM Right Click Tools
http://myitforum.com/cs2/blogs/rhouchins/archive/2008/04/09/sccm-right-click-tools.aspx
Hace mas de un año que no se acutaliza pero contiene gran cantidad de funciones para administrar SCCM. Una vez instalada la aplicación se modifica las opciones que se tienen al utilizar el botón derecho del mouse agregando gran cantidad de acciones muy útiles.
Como esta aplicación modifica la consola de SCCM, recomiendo no instalarla en el servidor de SCCM.

A probarlas y comentarme que les han parecido!

Gaston!

jueves, 15 de diciembre de 2011

Modificar inventario en SCCM - sms_def.mof y configuration.mof

Hola!

Muchas veces nos hemos preguntado si estamos modificando correctamente los ficheros sms_def.mof y configuration.mof.
Ciertas veces hasta se nos olvida que una aplicacion puede ser también de 64 bits y no terminamos obteniendo los resultados que esperábamos.

Esta utilidad RegKeyToMOFv3.zip nos permite realizar automaticamente la modificación que necesitamos realizar en los ficheros sms_def.mof y configuration.mof.
http://dl.dropbox.com/u/45821515/RegKeyToMOFv3.zip


Con solo seleccionar la llave de registro de la cual deseamos obtener información, la aplicación generará la consulta que debemos agregar al final de los ficheros.
Como podrán ver pueden seleccionar la opción "Enable 64bits (for Regkeys not written in Wow6432Node)" para capturar también correctamente aplicaciones de 32 bits en Windows de 64bits

Espero que les sea de mucha utilidad.

Gastón Gardonio

miércoles, 7 de diciembre de 2011

Controlar agentes de SCCM - ClientHealthCollection

Hola!

Siempre estamos preguntandonos que equipos no reportan inventario hace una semana, cuales no tienen el agente funcionando correctamente, a cuales les falla el WMI, etc, etc..

Les acerco esta herramienta la cual crea una serie de colecciones jerarquizadas en SCCM para poder tomar acciones correctivas directamente.

Esta 100% probada y es la herramienta perfecta para utilizar con las RightClickTools

http://dl.dropbox.com/u/45821515/ClientHealthCollection.rar

Saludos!

Gaston Gardonio

jueves, 1 de diciembre de 2011

Forzar inventario de Hardware y Software

Hola!!

Bueno, post rapido. Recién tuve que forzar el inventario de varios equipos y me topé con estos scripts que tenia guardado.

Ejecutar con credenciales de administrador.

Script: Full software inventory scan

'Reset SMS Software Inventory Action to force a full HW Inventory Action
sInventoryActionID = "{00000000-0000-0000-0000-000000000002}"
' Get a connection to the "root\ccm\invagt" namespace (where the Inventory agent lives)
Dim oLocator
Set oLocator = CreateObject("WbemScripting.SWbemLocator")

Dim oServices
Set oServices = oLocator.ConnectServer( , "root\ccm\invagt")

' Delete the specified InventoryActionStatus instance
oServices.Delete "InventoryActionStatus.InventoryActionID=""" & sInventoryActionID & """"

'Pause 3 seconds to allow the action to complete.
wscript.sleep 3000
'######################################
'Run a SMS Software Inventory
Set cpApplet = CreateObject("CPAPPLET.CPAppletMgr")
Set actions = cpApplet.GetClientActions
For Each action In actions
If Instr(action.Name,"Hardware Inventory") > 0
Then action.PerformAction
End if
Next



Script: Full hardware inventory scan

'Reset SMS Hardware Inventory Action to force a full HW Inventory Action
sInventoryActionID = "{00000000-0000-0000-0000-000000000001}"

' Get a connection to the "root\ccm\invagt" namespace (where the Inventory agent lives)
Dim oLocator
Set oLocator = CreateObject("WbemScripting.SWbemLocator")

Dim oServices
Set oServices = oLocator.ConnectServer( , "root\ccm\invagt")

' Delete the specified InventoryActionStatus instance
oServices.Delete "InventoryActionStatus.InventoryActionID=""" & sInventoryActionID & """"

'Pause 3 seconds to allow the action to complete. wscript.sleep 3000
'######################################
'Run a SMS Hardware Inventory
Set cpApplet = CreateObject("CPAPPLET.CPAppletMgr")
Set actions = cpApplet.GetClientActions
For Each action In actions
If Instr(action.Name,"Hardware Inventory") > 0 Then
action.PerformAction
End if
Next


Saludos!