Quantcast
Channel: Collections – All about Microsoft Endpoint Manager
Viewing all 43 articles
Browse latest View live

SCCM collection based on Heartbeat Agent

$
0
0

In my previous post,showed you how to create SCCM report to show computers with heartbeat timestamp http://eskonr.com/2011/11/sccm-report-for-computers-with-heartbeat-time-stamp/ . In this post ,you will Create a collection that gets all computer names based on heartbeat discovery agent: Create a new collection and past the below query into it.

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 ResourceId in (select ResourceID from SMS_R_System where AgentName in (“Heartbeat Discovery“) and DATEDIFF(day,AgentTime,GetDate())<23)

Replace the number of days and agent name as you desire which is in bold letters.

 


SCCM collection Query do not have particular exe installed

$
0
0

Use Subselected query to get the results:

select *  from  SMS_R_System where SMS_R_System.NetbiosName like “%rts%” and SMS_R_System.ResourceId not in (select SMS_R_System.ResourceID  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 like “rtvscan.exe” AND SMS_R_System.Client = 1)

 

SCCM collection Sub selected Quiries

$
0
0

Have seen lot of questions on how to get list of computers that do not have xxxxxx .This xxxx could be of anything like softwares,file names anything that do not have.

In this post,I will go through step by step procedure how to make it simple.

Step 1: To get list of computers that do not have xxxx,create a collection query that has xxxx. I think this is pretty much easy how to do it using criteria.

Create new collection and edit the query .

Subselected quiries 1 271x300 SCCM collection Sub selected Quiries

Click on Criteria Tab , click Yellow Burst

Subselected quiries 2 269x300 SCCM collection Sub selected Quiries

In the Criterion properties page, click on select

Subselected quiries 3 266x300 SCCM collection Sub selected Quiries

select attribute class and attribute which you want ( here i go with add and remove programs)

Subselected quiries 4 300x177 SCCM collection Sub selected Quiries

 

select the display name which you like xxxxx .I go with Adobe Acrobat .Why i used % is ,it list all computers that contains word like Adobe Acrobat.

Subselected quiries 5 268x300 SCCM collection Sub selected Quiries

Now Click on Show query Language to get the WQL code:

Subselected quiries 6 269x300 SCCM collection Sub selected Quiries

Here is the code we have got that list all computers with particular software installed :

select *  from  SMS_R_System 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 Acrobat%”

so cut the query and paste it in notepad we need this again.You will see blank query now.

Subselected quiries 7 269x300 SCCM collection Sub selected Quiries

Step 2: In this step,we will create collection with subselected criteria to get what we need .

Click on the Yellow Burst once again and select criterian type as “Subselected Values” and click on select

Subselected quiries 8 270x300 SCCM collection Sub selected Quiries

 

Subselected quiries 9 300x178 SCCM collection Sub selected Quiries

 

and select the operator as not in and past the query which you copied earlier into it.

Subselected quiries 10 270x300 SCCM collection Sub selected Quiries

 

query which we created earlier is :

select *  from  SMS_R_System 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 Acrobat%”

Replace * with SMS_R_System.ResourceID in your qeury and click on Ok.

Subselected quiries 11 267x300 SCCM collection Sub selected Quiries

 You can also filter the above collection to look only for windows 7 computer i.e OS version 6.1 etc .

configMgr collection do not contain letters in it

$
0
0

The collection listed below might help you to identify if any computers in organization that do not follow the standard naming convention .

Below collection is created to list servers and do not contain specific words in computer name:

select SMS_R_System.Name, SMS_R_System.OperatingSystemNameandVersion from  SMS_R_System where (SMS_R_System.OperatingSystemNameandVersion like “%Server 6.%” or SMS_R_System.OperatingSystemNameandVersion like “%Server 5.%”) and SMS_R_System.ResourceId not in (select ResourceID  from  SMS_R_System where SMS_R_System.Name like “%xxx%”)

The Logic is : list all servers with criteria given above and computer do not have xxx word in it.

Please change the bold letters as per the requirement.

 

SCCM collection Computers with 1GB RAM and Office product installed

$
0
0

SCCM collection that returns all windows XP or Windows 7 machines which has 1 GB of RAM(1024*1024 KB) running with MS office products.

select *  from  SMS_R_System inner join SMS_G_System_X86_PC_MEMORY on SMS_G_System_X86_PC_MEMORY.ResourceId = SMS_R_System.ResourceId inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_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_X86_PC_MEMORY.TotalPhysicalMemory = 1048576 and (SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows XP%" or SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows 7%") and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Microsoft Office 2003%"

 

Edit the display name correctly from your Add and remove programs and change the RAM as per the needs.

SCCM collection for X86 or X64 servers

$
0
0

collection to get all 32 Bit and 64 Bit servers.

 

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 inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where (SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC" or SMS_G_System_COMPUTER_SYSTEM.SystemType = "X86-based PC") and SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server%"

Reference Via http://social.technet.microsoft.com/Forums/en-US/configmgradminconsole/thread/ee47ec21-b113-4aed-956d-36205b619091

SCCM collection to use wildcard in String matching

$
0
0

Creating collection to get computers that starts and end with particular string is used mostly using % .If this percentile used at the end of the variable name, you get all computer names that starts from particular string and if you use this in the beginning, gets all computers that ends with particular string.

Examples : To get all computer names that starts with ESKONR, use ESKONR% , to get all computer name that ends with ESKONR ,use %ESKONR.

But what if  need all computer name that has letters like ESK in the middle of the computer name. Let says i have computers with 15 digits and they have ES placed in 10-11 . Example : INHYD1202ES0003

We can use underscore as wildcard for one character space and use them along with Like statement and apply to fields.

Collection :

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 like "__________ES___" and SMS_R_System.ResourceDomainORWorkgroup = "ESKONR"

We have used 9 underscores in our query before E and 4 Underscores after S to tell that first 9 digits can be any thing and last 4 digits can be anything .

Underscores (_) as wildcard can be used at any location in the query but one can replace one character only.

Hope it helps!

SCCM collection/Report Duplicate computer names with different Resource ID

$
0
0

I was looking at client health percentage other day and found many systems were reported as not healthy though I fixed some of the machines with sccm client installed and able to receive policies.

Looked at Database for healthy computers and see double entries with different ResourceID ,client0 and HardwareID0 is NULL.

So what next ? I created collection with filter computers with sccm client installed and should be in computers with no sccm client.

Collection:

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 SMS_R_System.Client is not null) and
SMS_R_System.Client is null

Report:

select name0 from v_R_System where client0 is null
and Name0 in( select Name0 from v_R_System where client0 =1)
order by name0

I see 100+ computers which are duplicate with same hostname but different value for ResourceID,client0 and hardwareID0 etc.

Special delete will remove them completely from database.


SCCM collection if Role (SUP) is missing on Primary / Secondary

$
0
0

 

Collection to check if any of Primary or Secondary site not installed with SUP Role or any other Role?

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.SystemRoles like "SMS Site System" and SMS_R_System.ResourceId not in (select ResourceID  from  SMS_R_System where SMS_R_System.SystemRoles like "SMS Software Update Point")

Collection can be modified to check if any of the Roles is missing on sites.

SCCM Migration report Collections with mix of users and computers

$
0
0

If you are planning to migrate your SCCM 2007 environment to SCCM 2012,you may have to think about your packages,collections,OSD and other stuff.

you cannot migrate all collections from SCCM 2007 to SCCM 2012.Couple of things to note before you migrate them.

Points to note  on collection migration:

1. Collection can contain only either devices or users but not both.

2.  Every collection must have Limitation.

3.   Sub collections are no longer exists instead you have folders.

blogged couple of posts on archiving/removing packages not been used for X days that will help you to not migrate them to CM12.

In this blog,will show you how to identify the collections that has both users and computers member of it  to look at the collections if you want to take of users/Computers query before you go on migration.

Configmgr Report:

select
fcm.CollectionID ‘Collection ID’,COLL.Name
from
v_FullCollectionMembership fcm,v_Collection COLL
where fcm.CollectionID=coll.CollectionID
group by
fcm.CollectionID,COLL.Name
having
count(distinct fcm.ResourceType) > 1

SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

$
0
0

Few Days ago,Microsoft released Cumulative Update 3 (supersedes Cumulative update 2 ) for Configuration Manager 2012 SP1 which has around 18 fixes related OSD,Powershell,Software Distribution etc.

More about the hotfix and download refer http://support.microsoft.com/kb/2882125

Installation of Cumulative Update 3 on Configurations manager SP1 is straight forward.you would need to follow the steps,next,next ,done.

This Cumulative Update contains updates for CAS,Primary site(both Stand alone,Hierarchy),Secondary Site,SMS Provider,Configmgr Console and Configmgr Client.

I have updated my Lab with Cumulative Update 3 today,saw couple of packages gets created with this update.

Note:Close the Configuration Manager Administrator Console before you install this update.

After the installation is completed,you will see 4 Packages created 1) Console 2) server (Primary and Secondary) 3) X86 Client and 4 ) X64 Clients

Note: Configuration manager 2012 SP1 CU3 Client version : 5.00.7804.1400.

image thumb14 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

Packages resides on HotFix Folder from your Configmgr Drive.image thumb8 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

Distribute these packages to selected distribution points,monitor the status(distmgr.log,sender.log and pkgxfermgr.log) .

Note :This patch will not install automatically on the Configmr clients, You should distribute the patch (msp file) to all existing clients in the environment.

We will now create collection for each update and then deploy the patch.

SP1 CU3-Console Update:

Select SMS_R_SYSTEM.Client from SMS_R_System 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 = “Microsoft System Center 2012 Configuration Manager Console
and SMS_R_System.Client = “1″ and SMS_R_System.Active = “1″

SP1 CU3-Server Update (all Pri and Sec) :

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.SystemRoles = “SMS Component Server

 

SP1 CU3 –X86 Client Update:

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 on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId
inner join SMS_G_System_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceId = SMS_R_System.ResourceId
where SMS_R_System.Client = “1″ and SMS_G_System_SYSTEM.SystemType = “X86-based PC”
and SMS_R_System.Active = “1″ and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.DisplayName = “CCM Framework”
and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version != “5.00.7804.1400

SP1 CU3 –X64 Client Update:

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 on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId
inner join SMS_G_System_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceId = SMS_R_System.ResourceId
where SMS_R_System.Client = “1″ and SMS_G_System_SYSTEM.SystemType = “X64-based PC”
and SMS_R_System.Active = “1″ and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.DisplayName = “CCM Framework”
and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version != “5.00.7804.1400

After you do this,collections will populate computers.

 

image thumb9 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

Right click on package, deploy to respective collection with required schedule.

image thumb10 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

Go to the client,do machine policy if you want this to happen quick else wait for the default machine policy retrieval.

Before the CU3 Patch installation,Client Version: 5.00.7804.1000 (SP1)

image thumb11 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

After the Patch Installation:

image thumb12 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients Client is Upgraded to CU3 with version 5.00.7804.1400

image thumb13 SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients

SCCM Configmgr 2012 SP1 CU3 Installation,Collections ,Upgrade Clients is a post from: Eswar Koneti's Blog

Configmgr SSRS Report:List all collections with count of client installed,assigned,active and Obsolete

$
0
0

There was a question in forum list about how to get count of clients by its status (active,obsolete etc). I looked at it if there is any way to get it without report but No.

In Configuration Manager 2007,to know the count of Computers from collection,You right click on collection,click show Count will give us the information but in Configmgr 2012,this is not possible until you develop some custom tools to get this.By default ,You can only see the total number of clients Count and members visible but not how many active,obsolete etc .

 

image thumb5 Configmgr SSRS Report:List all collections with count of client installed,assigned,active and Obsolete

 

I created simple report that produces this info.

Use the Below SQL Code to create SSRS report.

select fcm.collectionid [Collection ID],coll.Name,
count(case when fcm.IsActive=1 then ‘*’ else NULL end) [Active Clients],
count(case when fcm.IsClient= 1 then ‘*’ else NULL end) [Client Installed],
count(case when fcm.IsAssigned=1 then ‘*’ else NULL end) [Assigned Clients],
count(case when fcm.IsObsolete= 1 then ‘*’ else NULL end) [Obsolete Clients]
from v_FullCollectionMembership fcm,v_Collection coll
where fcm.ResourceType=’5′ and fcm.CollectionId=coll.CollectionID
group by fcm.CollectionID,coll.Name
order by fcm.CollectionID

Note:Change the quotes as they are not regular.

SSRS Results:

image thumb6 Configmgr SSRS Report:List all collections with count of client installed,assigned,active and Obsolete

Configmgr SSRS Report:List all collections with count of client installed,assigned,active and Obsolete is a post from: Eswar Koneti's Blog

SCCM Configmgr 2012 Collection for computers with Primary User (UDA) is NULL

$
0
0

If you are using User Device Affinity–associating a user with one or more specified devices  for application deployment to make sure the application install on all devices that are associated with that user,it is necessary to identify the computers which do not have primary User Defined.More about User Define Affinity http://technet.microsoft.com/en-us/library/gg699365.aspx.

Create collection using below WQL query for list of computers with Primary Device is NULL.(Make sure you limit the collection to computers with Client installed and Active) else you will get all computers who do not have sccm client installed .

WQL query uses wmi class (SMS_UserMachineRelationship) which store the information only about UDA relationship. Usermachinerelationship will not have any entries for computers do not have UDA relationship.

so I use subselected query using not in function.Get list of computers for which UDA relationship is not null and compare them with v_r_system active clients.

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 not in (select resourceid from SMS_UserMachineRelationship where UniqueUserName is not null)

 

Hope it helps.

SCCM Configmgr 2012 Collection for computers with Primary User (UDA) is NULL is a post from: Eswar Koneti's Blog

Configmgr 2012 Delete duplicate ,Obsolete records etc using collections

$
0
0

Few days back,I was working on Client health remediation issues.for this activity,I created some cool SSRS reports based on client health statistics(soon,will post them on the blog) how many are with client,without client etc.

count of missing clients are not too bad (few hundreds) but still need to get possible clients* into configmgr console using different client installation methods like client push,logon script etc.

During this process,I found many clients are with duplicate records,obsolete ,multiple resource ID with same computer name.More via http://social.technet.microsoft.com/Forums/systemcenter/en-US/8f3fd7cd-0e3d-4429-bcde-02b2ec77324d/report-showing-servers-showing-two-os?forum=configmgrgeneral#ac775d37-141a-404c-a345-7d882b1bbe17

the above issues are addressed in multiple blogs—- how to create collection to find duplicate records and delete them from database but I thought of presenting all in this blog including new issue—One computer with different Resource IDs

I ran below SQL query on SSMS (management Studio) ,found many entries .pick one computer and ran select * from v_r_system where name0=’computer name’ .This results 2 entries for one computer name,both the computers are active,No Obsolete,Client is 1 ,what else I can check to differentiate between .This is really confusing ,you should try to fix it by somehow else you will impact on patch compliance % because only one computer will send the compliance report but no other.

select sys.name0
from v_r_system sys
group by  sys.name0
having count(sys.name0) >=2

How do you cleanup this mess from Database ?

Created a collection with all these entries using query based or what ever you prefer and delete them from database.don’t worry though,these deleted computers will be back to the console with their next DDR cycle.

List of collection you need to have in place to cleanup duplicate entries are:

Duplicate Computer Names:

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 and R.Client = null

Duplicate Resource ID with same Computer Name(based on Active Status):

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.Active is null  and SMS_R_System.Name in (select Name  from  SMS_R_System where SMS_R_System.Active = "1")

Obsolete 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 where SMS_R_System.Obsolete = "1" and SMS_R_System.Name not like "Unknown"

 

You can either manually delete the entries from collection or create schedule job which performs delete resources from the collection using task scheduler .

Configmgr 2012 Delete duplicate ,Obsolete records etc using collections is a post from: Eswar Koneti's Blog

SCCM Configmgr 2012 Powershell script cleanup duplicate obsolete and outdated computers Via Task Scheduler

$
0
0

This post is continuation to my previous post on how to clean outdated computers from configmgr Database. More info refer , http://eskonr.com/2014/03/sccm-configmgr-2012-delete-duplicate-obsolete-records-etc-using-collections/

Through this post,i will show you to create schedule task to delete the computers from specific collections to maintain configmgr database healthy.

In my previous blog,we have seen how to create collections for duplicate,obsolete,computers not contacted to domain during X days with hardware inventory older than 30 days etc.

Note: if you are imaging the computers frequently ,you may see many duplicate/obsolete computers are you are required to cleanup those entries at regular intervals.

Creating collections is nice but how frequent do you clean these entries ? keep checking once in week or once in month to delete the entries from database to have healthy environment and high success ratio on client health when your boss ask for client health statistics?

There are configmgr Maintenance tasks that does the cleanup job for you like delete inactive,aged inventory data etc based on what task you enable. More about Maintenance tasks,refer http://eskonr.com/2012/01/configmgr-sccm-2012-site-maintenance-tasks/ and default settings for maintenance tasks http://support.microsoft.com/kb/2897050

Through this post,i will show how to create powershell script to do the removal of computer records from specific collections (you can have many collections that contains out dated computers with different criteria) and empty the collection on scheduled basis.

 

I have captured few lines of code from David blog http://www.david-obrien.net/ to get site code,site server name etc instead of providing them manually.

Download the script from TechNet Gallery http://gallery.technet.microsoft.com/SCCM-Configmgr-2012-1446ec07

Script function: It takes the collectionIDs as input parameter what you supply while running the script,check if the collection Exist ,check if the collection is not empty  and then perform removal of computer Objects.

Before removal of computer objects ,script will write computer objects to txt file for reference incase you need check later.

After you download the script,put it in either share folder or on local server.

PS:You don't have to make any changes to the script ,just get the collection's which you want to cleanup.

Create Task scheduler with recurring weekly or monthly at your convenience,get help from http://windows.microsoft.com/en-sg/windows/schedule-task#1TC=windows-7 .

After you create Task scheduler,open the properties of Task and go to Action Tab,select the Actions ,click on Edit.

image thumb SCCM Configmgr 2012 Powershell script cleanup duplicate obsolete and outdated computers Via Task Scheduler

For program,/Script: type PowerShell.exe ,and for Arguments (Optional): type -command "& 'G:\SCCM Tools\delete-resources-from-collection.ps1' 'PRI0001E' ,'PRI00020'

where 'G:\SCCM Tools\delete-resources-from-collection.ps1: is powershell script what we created earlier and PRI0001E,PRI00020 are the collections that i have to cleanup. If you have more collections ,just append the existing command like with ,’collectionID’.

Actions Tab:

image thumb1 SCCM Configmgr 2012 Powershell script cleanup duplicate obsolete and outdated computers Via Task Scheduler

Make sure you run the task with right permissions on the database .you can change the account name to run the task from General Tab:

image thumb2 SCCM Configmgr 2012 Powershell script cleanup duplicate obsolete and outdated computers Via Task Scheduler

run the task,wait until it finishes. Go back your script location,you will see .txt file created with script ran date:

image thumb3 SCCM Configmgr 2012 Powershell script cleanup duplicate obsolete and outdated computers Via Task Scheduler

The txt file contains list of computers which are removed from the specific collection.

Hope if helps for someone who wants to keep database active without outdated Clients ;).

If you want to know what causes the client become Inactive ,refer http://www.david-obrien.net/2014/04/12/configure-client-activity-settings-configmgr/

SCCM Configmgr 2012 Powershell script cleanup duplicate obsolete and outdated computers Via Task Scheduler is a post from: Eswar Koneti's Blog


SCCM Configmgr 2012 way to find Who Created modified Deleted the collection using SSRS Reports

$
0
0

Quick Post: There was a question on TechNet forum asking,about who created the collection ,More read http://social.technet.microsoft.com/Forums/en-US/e5ea645e-84ec-49ce-82f5-e5d92b0f49a5/details-on-sccm-collection-creation?forum=configmanagergeneral

I have seen few cases in Configmgr 2007 and less in Configmgr 2012 due to RBA ,that Configmgr guys will try to do something on collection but it ends at something that causes the resources to disappear from Configmgr database and later you know the consequences from top management. The easiest way to get the resources into Configmgr is,to run the discovery.

Recently peter posted a blog about Who created that deployment and who deleted that deployment but these posts mainly focus on the deployment part using Reports.

Through this post,i will provide you the information about collections like who created,who Modified ,who deleted and who deleted resources from the collection etc using Reports.

Unlike Configmgr 2007 ,Configmgr 2012 also have few ways to get the information about this 1) using Status messages queries 2 ) Default reports 3) Using SQL queries

I always prefer to use the Default report in Configmgr called ‘All messages for a specific message ID’ under status messages folder from your Configmgr SSRS reports folder to know who created ,deleted as other 2 methods are little complicated to search for the required information(compared to reports) and to write SQL queries.

So coming to the subject,you can run the default report but you need to know the description of the status message ID what you are looking for.

You can use below status message ID’s to know who did what on collections.

 

Message ID

                                                             Description

30015

User "<>" created a collection named "Coll Name" (CollID)

300016

User "<>" modified the Collection Properties for a collection named "Coll Name" (CollID)

300017

User "<>" deleted a collection named "Coll Name" (CollID)

300067

User "<>" deleted all of the resources that belong to collection "Coll Name" (CollID)

30104

User "<>" requested that the membership be refreshed for collection "Coll Name" (CollID)

30107

User "<>" requested that the CCRs be generated for collection "Coll Name" (CollID)

30066

User "<>" deleted a discovered resource named "ComputerName" ResourceID

 

Report Results for Who deleted what Collections ?

image thumb4 SCCM Configmgr 2012 way to find Who Created modified Deleted the collection using SSRS Reports

If you are looking for information about Configmgr 2007,refer this post http://blogs.technet.com/b/configurationmgr/archive/2013/10/01/how-to-determine-who-deleted-what-objects-in-the-configuration-manager-console.aspx

Hope it helps.

SCCM Configmgr 2012 way to find Who Created modified Deleted the collection using SSRS Reports is a post from: Eswar Koneti's Blog

How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

$
0
0

In this post, i will discuss about how to install CU3 update and  How to Upgrade clients to CU3 with query based collections.

Installation of CU3 is not so difficult ,it is straight forward .If you need step by step with screenshots ,you can refer my previous post http://eskonr.com/2014/03/how-to-install-configmgr-2012-r2-cu1-part-1/ 

So,as i discussed in my previous post about the CU3 update : it contains many bug fixes with respect to Powershell and other Site server and client functionalities including 3 important new changes to this update.

1) you can now assign the clients to Specific Management point (kind of restrict the client to always choose specific MP but incase of MP failure,client will be Unmanaged ,there is no fallback). Justin had explained in nice way ,more info about Management point affinity http://blogs.technet.com/b/jchalfant/archive/2014/09/22/management-point-affinity-added-in-configmgr-2012-r2-cu3.aspx

2) Child sites may perform partial WSUS synchronization when the primary is under heavy load. This partial synchronization occurs when the WSUS Synchronization Manager component on a primary site begins synchronization before WSUS has completed processing all updates metadata.

3) The following operating systems are added to the list of supported platforms for software distribution:

  • Debian 7 (x86)
  • Debian 7 (x64)
  • Red Hat Enterprise Linux 7 (x64)
  • CentOS 7 (x64)
  • Oracle 7 (x64)

So before we start,try downloading the CU3 update from http://support.microsoft.com/kb/2994331 and extract it.

After you have the file,try to run with file with administrative permissions.

 

image thumb6 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

As you can see from above screen,you can install CU3 on CAS,Primary,Secondary,SMS Provider and Console.

The Installation procedure is straight forward , but make sure you don't have any reboot pending while installing this CU ,also close any administrative consoles open which are connected to the SMS provider.

after you click next,next next,you see summary window:

image thumb7 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

Log will be created under C:\windows\temp\cm12-r2cu3-kb2994331-x64-enu.log with CU3 installation progress.

image thumb8 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

after a while,you see success

image thumb9 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

Check your Console if it is updated to Right version or not.

image thumb10 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

From Registry : HKLM\software\Microsoft\SMS\setup: CULevel =3

image thumb11 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

After you are done with the installation of CU3, you are need to distribute the CU3 packages (Console,Server,X86 and X64) to Distribution points .

image thumb12 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

and next ,create collections to upgrade the clients which are lower version < CU3 version but >=R2 to CU3.

I did not discuss about installation of CU3 on secondary site servers on this blog .If you are having multiple secondary sites,you can create collection by referring to my old blog post or you can install CU3 patch called : R2 CU3 – Server Update package manually.

Note: you can install this Update only on clients which are running on CM12 R2 + any Cumulative update but not on any other versions.

Now we need to upgrade clients to CU3 version from Configmgr 2012 R2 + CU1 or CU2

lets try creating collections for X86,x64 and Console :

Collection for R2 CU3-Console Update:

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_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "System Center 2012 R2 Configuration Manager Console"

Collection for R2 CU3 Client x86:

This will list all configmgr Clients with criteria : should include X86,Client=1,Client <CU3 (5.00.7958.1401) and client version >= R2( 5.00.7958.1000).

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 inner join SMS_G_System_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.SystemType = "x86-based PC" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.DisplayName = "CCM Framework" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version >= "5.00.7958.1000" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version < "5.00.7958.1401"

Collection for R2 CU3 Client X64:

This will list all configmgr Clients with criteria : should include X64,Client=1,Client <CU3 (5.00.7958.1401) and client version >= R2( 5.00.7958.1000).

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 inner join SMS_G_System_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.DisplayName = "CCM Framework" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version >= "5.00.7958.1000" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version < "5.00.7958.1401"

 

image thumb13 How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3)

Now you have  packages and  collections ready for deployment .Deploy the CU3 package to respective Collection to upgrade the clients to CU3 level.

Monitor the report for the the Deployment status .

Happy Upgrade icon smile How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3) ---

How to Install and upgrade clients to Configmgr 2012 R2 Cumulative Update 3 (CU3) is a post from: Eswar Koneti's Blog

SCCM Configmgr 2012 How to Create Collection to get list of computers from Users OU using UDA

$
0
0

I had a requirement to deploy patches (part of patch testing) to Department (group of user around 200+) who resides in one OU in Active Directory .The computers used by them are different due to their work nature and they keep moving with different computers (with different apps). I need to get list of computers used by these 200+ users from specific Organizational unit in Active Directory.

With CM12,feature called User Device Affinity --associating a user with one or more specified devices and it eliminates the need to know the names of a user’s devices .More info about UDA ,refer http://technet.microsoft.com/en-us/library/gg699365.aspx

How to do I use this feature (UDA) to get computers that are associated with users from specific OU ?

Long ago ,I posted Collection query to get list of computers with primary user (UDA) is NULL means http://eskonr.com/2014/03/sccm-configmgr-2012-collection-for-computers-with-primary-user-uda-is-null/

I use instance called SMS_UserMachineRelationship to get the User machine relationship.

Create a device collection ,limit to whatever collection you want and then add query rule ,paste the below query and click ok.

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   JOIN SMS_UserMachineRelationship ON SMS_R_System.ResourceID=SMS_UserMachineRelationship.MachineResourceID   JOIN SMS_R_User ON SMS_UserMachineRelationship.UniqueUserName = SMS_R_User.UniqueUserName
WHERE   SMS_UserMachineRelationship.RelationActive=1 AND   SMS_R_User.UserOUName = "ESKONR.COM/BLG/WF/GIM"

Change the bold letters to the required OU.

ESKONR.COM/BLG/WF/GIMContains list of users and we are retrieving the computers which are associated with UDA.

Hope it helps!

SCCM Configmgr 2012 How to Create Collection to get list of computers from Users OU using UDA is a post from: Eswar Koneti's Blog

SCCM 2012 Collection SSRS report with No SEP client or SEP Client is older version

$
0
0

Rolled out new Symantec endpoint Protection (SEP) Version to clients across all the sites. After few days ,report (All application deployment –Basic)  says ,around 100+ computers still running on old version which did not upgraded to deployed version.Out of these 100+ clients,some of them already have deployed version if I check via resource explorer (also check from DB with v_add_remove_programs).So ,it assume that,reports having some problem (Table that it retrieve the info from).

Since ,the reports are giving inaccurate results,I feel ,It would be good to have these failed clients into one collection to perform certain actions (I know there are tools that you run the specific action or other ways to do it) or let the helpdesk focus only these computers to troubleshoot the issue.with this way,we at least can get the real computers that have SEP failed/unknown or whatever the status.

To get list of computers without specific application or application did not upgrade to deployed version,we need to go with subs elected query. In tis collection,we look for computers that did not upgrade to deployed version with limiting collection(original deployed collection).

First create collection that have deployed SEP version installed and then use resourceid not in to get failed computers. In this case, we need to perform this on both 32bit (SMS_G_System_ADD_REMOVE_PROGRAMS) and 64bit(SMS_G_System_ADD_REMOVE_PROGRAMS_64)

image

Collection list computers that have SEP version installed for 32bit:

select SMS_R_System.ResourceId from  SMS_R_System 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 = "Symantec Endpoint Protection" and SMS_G_System_ADD_REMOVE_PROGRAMS.Version = "12.1.5337.5000"

Collection list computers that have SEP version installed For 64bit:

select SMS_R_System.ResourceId from  SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId

where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName = "Symantec Endpoint Protection" and SMS_G_System_ADD_REMOVE_PROGRAMS_64.Version = "12.1.5337.5000"

Now go with original query creation with resourceID not in from both above queries:

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 not in
(select SMS_R_System.ResourceId from  SMS_R_System 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 = "Symantec Endpoint
Protection" and SMS_G_System_ADD_REMOVE_PROGRAMS.Version = "12.1.5337.5000")
and SMS_R_System.ResourceId not in
(select SMS_R_System.ResourceId from  SMS_R_System inner join
SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId
where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName = "Symantec Endpoint
Protection" and SMS_G_System_ADD_REMOVE_PROGRAMS_64.Version = "12.1.5337.5000")

If you want to create collection for computers that did not have specific application ,you can just replace the display name with desired one and remove the version field.

SSRS Report /SQL Query:

select
R.netbios_name0,
R.user_name0,
OS.Caption0 AS 'Operating System',
ES.SerialNumber0 AS 'Serial Number' ,
varp.displayname0,varp.version0
from
dbo.v_R_System R
join dbo.v_GS_OPERATING_SYSTEM OS on OS.ResourceID = R.ResourceID
JOIN dbo.v_GS_System_Enclosure ES on ES.ResourceID = R.ResourceID
JOIN dbo.v_FullCollectionMembership AS vfcm ON vfcm.ResourceID = R.ResourceID
join dbo.v_Add_Remove_Programs AS varp ON varp.ResourceID = R.ResourceID
where
R.ResourceID not in
(
select distinct
ARP.ResourceId
From
dbo.v_ADD_REMOVE_PROGRAMS ARP
join dbo.v_GS_System S on ARP.ResourceID = S.ResourceId
where
ARP.DisplayName0 ='Symantec Endpoint Protection' AND ARP.version0 like '12.1.5337.5000'

)
and vfcm.CollectionID='CMS000FF'
AND varp.DisplayName0='Symantec Endpoint Protection'

 

 

How to Upgrade Clients to SCCM 2012 R2 CU4

$
0
0

It has been almost month for now ,since the release of Configmgr 2012 R2 CU4.To know more about what CU4 includes,you can refer the KB3026739 article http://support.microsoft.com/kb/3026739.

Installation of Configmgr 2014 CU4 is similar to installation of previous Cumulative updates and it is straight forward.

If you miss to install the Previous Cumulative updates,you can directly apply CU4 on Configmgr 2012 R2 .

To check if CU4 installed ,you can check the Admin console version in the About System Center Configuration Manager dialog box and version should be 5.0.7958.1501.

You can also check the registry key if CU level is updated or not .From Registry HKEY_LOCAL_MACHINE\Software\Microsoft\SMS\Setup ,CULevel should be set to 4.

After you are done with the installation of CU4,you are required to install or upgrade clients to R2 CU4 (5.0.7958.1501) version.

Before you do upgrade,you need to create collections for clients that lower the version of R2 CU4 (5.0.7958.1501).

Create collections to Upgrade Configmgr Admin Console, X86 clients and X64 clients.

 

image

R2 CU4-Console Update:

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_ADD_REMOVE_PROGRAMS on
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "System Center 2012 R2 Configuration Manager Console"

R2 CU4 Client X86:

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 inner join
SMS_G_System_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_COMPUTER_SYSTEM.SystemType = "x86-based PC" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.DisplayName = "CCM Framework" and
SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version >= "5.00.7958.1000" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version < "5.00.7958.1501"

R2 CU4 Client X64:

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 inner join SMS_G_System_SMS_ADVANCED_CLIENT_STATE on
SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC"
and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.DisplayName = "CCM Framework" and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version >= "5.00.7958.1000"
and SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version < "5.00.7958.1501"

Deploy the respective Cumulative update to these collections and monitor the reports for client health.

Monitor the report to see if majority of your clients upgraded to current version or not using http://eskonr.com/2014/04/sccm-configmgr-2012-ssrs-reportcount-of-client-versions-2/

Note: if you wonder why did the client version version did not updated in Database,it could be because of your heartbeat discovery set to run for more number of days .Client version comes with DDR Cycle which is heartbeat discovery cycle.

Viewing all 43 articles
Browse latest View live