Wednesday, 27 January 2010

Computers not in AD for longer than 15 days

Query to find computers in the console that have not been on the Domain for the last 15 days

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.Name in (select Name from SMS_R_System where ((DATEDIFF(day, SMS_R_SYSTEM.AgentTime, getdate()) >=45) and AgentName = "SMS_AD_SYSTEM_DISCOVERY_AGENT")) and SMS_R_System.Name in (select Name from SMS_R_System where ((DATEDIFF(day, SMS_R_SYSTEM.AgentTime, getdate()) >=45) and AgentName = "Heartbeat Discovery"))

All Virtual Computers Query

All virtual Computers query


select SMS_R_System.Name, SMS_G_System_COMPUTER_SYSTEM.Manufacturer, SMS_R_System.SMSAssignedSites, SMS_R_System.IPAddresses, SMS_R_System.IPSubnets, SMS_R_System.OperatingSystemNameandVersion, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.LastLogonUserDomain, SMS_R_System.LastLogonUserName, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.NetbiosName from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.Manufacturer in ("VMware, Inc.","Microsoft Corporation")

Wednesday, 20 January 2010

Mount and modify a current WIM file

This is an incredibly valuable task


An admin can capture a custom .WIM windows image and mount the WIM to add/modify/remove files. Did you know you can also edit the registry?



  • Prerequisites

Before you can mount and manipulate an image with ImageX, you must perform the following tasks:


Install Windows OPK tools or Windows AIK tools on your technician computer.
Use ImageX to capture (and, optionally, to compress) your installation to an image (.wim) file.
Create a folder on the c drive and call it: mount



  • To mount an image

On your technician computer, at a command prompt, open the ImageX directory.
c:\Program Files\\Tools\
.
Mount the image. For read-only permissions, use
imagex /mount d:\imaging\data.wim 2 c:\mount
For read/write permissions, use
imagex /mountrw d:\imaging\data.wim 2 c:\mount
where c:\mount is the location of the mount directory, d:\imaging\data.wim is the name and the location of the .wim file to mount, and 2 is the reference number of the specific volume in the .wim file.
Now you can open the mounted Image just like a folder structure through explorer, but the best part is that you can also modify the Registry setting
Load the registry hive you need. In this case let's mount HKLM\Software under the TEST name to identify the String in the registry.
C:\mount>reg load HKLM\TEST c:\mount\windows\system32\config\software
The operation completed successfully.
Open Regedit to make changes under the TEST string
Unload the reg hive.
C:\mount>reg unload HKLM\test
Then Unmount the Image with Commit switch to apply the changes to the WIM file – make sure you have closed explorer windows etc.
On your technician computer, at a command prompt, open the ImageX directory.
c:\Program Files\\Tools\
where can be Windows OPK or Windows AIK and can be x86, amd64, or ia64.
Then type:
imagex /unmount /commit c:\mount

If you do not use the commit switch no changes will be saved.

Tuesday, 19 January 2010

Windows 2008 Server settings to change prior to any SCCM installation

When installing Windows Server 2008, I recommend making the following changes.

1. Run this command to keep the hibernation file from growing out of control (gigabytes!) Also works for Vista.
powercfg -h off

2. Go into Administrative Tools>Local Security Policy>Local Policies>Security Options and change Network security. LAN Manager authenticaton level to Send LM & NTLM - use NTLMv2 session security if negotiated.

3. Install IIS and add following features;

BITS
Remote Differential Compression
ASP.NET
ASP
Windows Authentication
IIS 6 Metabase Compatibility
IIS 6 WMI Compatibility

WebDav - please follow exact steps for configuring Webdav!

1.Enable WebDAV and create an Authoring Rule, as follows:

a.Navigate to Start / All Programs / Administrative Tools / Internet Information Services (IIS) Manager to start Internet Information Services 7 Application Server Manager.


b.In the Connections pane, expand the Sites node in the navigation tree, and then click Default Web Site if you are using the default Web site for the site system or SMSWEB if you are using a custom Web site for the site system.


c.In the Features View, double-click WebDAV Authoring Rules.


d.When the WebDAV Authoring Rules page is displayed, in the Actions pane, click Enable WebDAV.


e.After WebDAV has been enabled, in the Actions pane, click Add Authoring Rule.


f.In the Add Authoring Rule dialog box, under Allow access to, click All content.


g.Under Allow access to this content to, click All users.


h.Under Permissions, click Read, and then click OK.


2.Change the property behavior as follows:

a.In the WebDAV Authoring Rules page, in the Actions pane, click WebDAV Settings.


b.In the WebDAV Settings page, under Property Behavior, set Allow anonymous property queries to True.


c.Set Allow Custom Properties to False.


d.Set Allow property queries with infinite depth to True.


e.If this is a BITS-enabled distribution point, under WebDAV Behavior, set Allow hidden files to be listed to True.


f.In the Action pane, click Apply.

PXE settings for DHCP options

066 Boot Server Hostname - SERVER.FQDN.COM
067 Bootfile Name - \SMSBoot\x86\wdsnbp.com

On PXE server open WDS and make sure it is set to not respond to clients and delay of 1 second.
On SCCM Console set delay for PXE to 0 seconds and the Database access has to be a Network account - not a machine account

Monday, 18 January 2010

USMT does not work in Task Sequence

OSD Task Sequence Fails on requesting state storage - The reason for that is KB974571.

Uninstall that Patch from the Target Client and USMT will work fine.

Microsoft are still working on releasing a patch that fixes that issue as of 12th January 2010

Fix has been released:
http://support.microsoft.com/kb/977203/en-us

Boot with 64Bit and deploying 32Bit OS....

Well folks let me tell you that if you use a 64Bit WinPe and you want to deploy a 32Bit Operating system it will not work.

You have to use the same PE build as the OS you want to deploy.

Example error from my OSD Task sequence:
It is not supported to deploy an x86 architecture OS from a amd64 boot image Installation of image 1 in package EUR000E8 failed to complete.. The request is not supported. (Error: 80070032; Source: Windows)

Monday, 11 January 2010

Forward slashes and Percentage signs in Advertisements

Thanks to George for the article below:

We had a problem last month where advertised programs stopped getting pushed out

http://social.technet.microsoft.com/Forums/en-US/configmgrswdist/thread/087262f4-18e8-46a0-876d-77027b5a74ce/

Anyway, the upshot is do not use forward slashes and percentage signs in advertisement names. They are special characters in SQL and mess everything up!

Friday, 8 January 2010

How to delete a duplicate Computer entry on SCCM the database

To delete a duplicate Computer entry on SCCM the database

!!!!only when you cannot find the duplicate within the sccm console itself!!!!
Make sure the DB has been backed up before you continue

The example below looks for a duplicate called PCNAME and removes the non valid entry.

select name0 , count (*) from v_r_system GROUP BY name0 having count (*) > 1;.
Should show duplicates

select * from v_R_System where Name0 = 'PCNAME'
Should show duplicates and more details. You now choose which duplicate to remove ( in this case Resource ID 12989 because Active0 is NULL)

delete from v_R_System where ResourceID = 12989
Deletes the choosen entry

Use ALT-X to execute single lines in a query

SQL query to identify missing SMS/ConfigMgr boundaries

SQL query to identify missing SMS/ConfigMgr boundaries

This came up on the MSSMS list from myitforum. Here is the final result of the collaboration. Here is a SQL query you can use to help identify missing boundaries for clients that are discovered.



SELECT DISTINCT

-- v_R_System.Name0

--, v_R_System.Client0

--, v_RA_System_IPAddresses.IP_Addresses0

v_RA_System_IPSubnets.IP_Subnets0

--, v_RA_System_SMSAssignedSites.SMS_Assigned_Sites0

FROM v_R_System LEFT OUTER JOIN

v_RA_System_IPSubnets ON v_R_System.ResourceID = v_RA_System_IPSubnets.ResourceID LEFT OUTER JOIN

v_RA_System_IPAddresses ON v_R_System.ResourceID = v_RA_System_IPAddresses.ResourceID LEFT OUTER JOIN

v_RA_System_SMSAssignedSites ON v_R_System.ResourceID = v_RA_System_SMSAssignedSites.ResourceID

WHERE (v_RA_System_SMSAssignedSites.SMS_Assigned_Sites0 IS NULL)

AND (NOT (v_RA_System_IPAddresses.IP_Addresses0 IS NULL))

AND (v_R_System.Client0 IS NULL)

AND (NOT (v_RA_System_IPSubnets.IP_Subnets0 IS NULL))

order by v_RA_System_IPSubnets.IP_Subnets0

Tuesday, 5 January 2010

Collection of computers that don't have software X installed

Create a collection of computers that needs to have software x installed but doesn't have it according to hardware inventory (Add/Remove Programs)

Sometimes you want to create a collection that will find all the computers that don't have a particular software installed and push it to it. This is a good dynamic way to create a collection instead of direct computer addition.

Assuming you have Adobe Reader setup to install to all computers you can key this off of the Workstation collection or limit it to a OU collection. You notice that I use the "LIKE" condition instead of the "equals." I do this because you never know what version you might have. Look at Reader 7.09, even though you update your package with the latest reader you would need to change the collection.
This way it will always look for the computers with no reader. This is assuming of course, that you push the updates to reader and not uninstall and reinstall the whole application each time.
As the hardware inventory updates the computers will be removed from the collection at refresh time.

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 on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_COMPUTER_SYSTEM.Name not in
(select distinct SMS_G_System_COMPUTER_SYSTEM.Name
from SMS_R_System
inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Adobe Reader 8%")

Collection of computers with a specific file or older version

Create a collection of computers that is based on a file found during Software inventory. these collections could be used to add a computer if the file is missing or if the file is the wrong date.

Sometimes you need to send a file to the computer multiple times. This is true with the Outlook.hol file. For those that are new to it, this file contains calendar entries for custom and standard information. Use this to file to give the dates of company vacations or events.
To acomplish this we will create a collection using 2 queries. This will pull in computers that are missing the file or have an old version of the file.
As the file changes add the package and changed the date in the query pull the computers back in.


Please note that you need to turn on File Inventory and search for the outlook.hol file.

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 where SMS_G_System_SoftwareFile.FileName = "OUTLOOK.HOL" and SMS_G_System_SoftwareFile.FileModifiedDate < "20070206 23:00:00.000" ------------------------- Query 2: No HOL file ------------------ 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 on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.Name not in (select distinct SMS_G_System_COMPUTER_SYSTEM.Name from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "OUTLOOK.HOL")

Query to find all Laptops

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_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where
SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( "8", "9", "10", "14" )

You may change this as needed here is the complete list from Micrsoft:
Value Description
1 Other
2 Unknown
3 Desktop
4 Low Profile Desktop
5 Pizza Box
6 Mini Tower
7 Tower
8 Portable
9 Laptop
10 Notebook
11 Hand Held
12 Docking Station
13 All in One
14 Sub Notebook
15 Space-Saving
16 Lunch Box
17 Main System Chassis
18 Expansion Chassis
19 Sub Chassis
20 Bus Expansion Chassis
21 Peripheral Chassis
22 Storage Chassis
23 Rack Mount Chassis
24 Sealed-Case PC

Monday, 4 January 2010

Best Free SCCM Tools

This time I want to devote a post to some of the best (free) tools for ConfigMgr 2007. These tools can make it a lot easier to manage, troubleshoot and develop you ConfigMgr 2007 environment.

SCCM Right Click Tools - SCCM Right Click Tools are an easy solution for managing all client action from the ConfigMgr Console by right clicking the client. Website: http://myitforum.com/cs2/blogs/rhouchins/archive/2008/04/09/sccm-right-click-tools.aspx

SCCM Client Center - SCCM Client Center is a tool to help troubleshoot and manage SCCM 2007 advanced clients (force inventory, show execution history, show running executions). Website: http://myitforum.com/cs2/blogs/rzander/archive/2009/11/30/sccm-client-center-v2-0-2-released.aspx

OSD++ - OSD++ is a better way to get input from the user and populate task sequences variables. Website: http://myitforum.com/cs2/blogs/jsandys/pages/osdplusplus.aspx

SMSMap - SMSMap is a freeware SCCM 2007 / SMS 2003 hierarchy drawing tool. It is an all-in-one solution for creating Visio drawings of any combination of SCCM 2007 and SMS 2003 site servers. Website: http://www.tondtware.com/default.htm

SCCMAutoDoc - SccmAutoDoc is a command-line utility that documents a System Center Configuration Manager 2007 site in a human-readable format. Website: http://scug.be/blogs/sccm/archive/2009/10/21/sccmautodoc-by-oscc-goes-beta-1.aspx

SCCM 2007 SDK - The SDK enables developers to build plug-ins for the Configuration Manager console, to build automation scripts for batch processing to the SMS Provider, and to manipulate client settings. Website: http://www.microsoft.com/downloads/details.aspx?familyid=064a995f-ef13-4200-81ad-e3af6218edcc&displaylang=en

SCCM-Tools.com – SCCM-Tools.com is a central place to find, request, and submit Configuration Manager 2007 tools. Website: http://www.sccm-tools.com/
BitsAdmin - BITSAdmin is a command-line tool that you can use to create download or upload jobs and monitor their progress. Website: http://msdn.microsoft.com/en-us/library/aa362813(VS.85).aspx

WMI Administrative Tools - WMI Tools include: WMI CIM Studio: view and edit classes, properties, qualifiers, and instances in a CIM repository; run selected methods; generate and compile MOF files. WMI Object Browser: view objects, edit property values and qualifiers, and run methods. Website: http://www.microsoft.com/downloads/details.aspx?familyid=6430F853-1120-48DB-8CC5-F2ABDC3ED314&displaylang=en

WMI Diagnosis Utility - WMIDiag.vbs is a VBScript script designed to help you ascertain the current state of the WMI service on a computer. Website: http://www.microsoft.com/downloads/details.aspx?familyid=d7ba3cd6-18d1-4d05-b11e-4c64192ae97d&displaylang