Archive | Configuration Manager

Add devices from a text file to a SCCM 2012 Collection

There is many versions of this out on the Internet. But this is mine!

This script will add all the devices in a file to a specified Collection. Just save the script below to a file called “AddDeviceToCollection.ps1” and change the section marked as “Change this section”. After this just run the command as follow:

.\AddDeviceToCollection.ps1 -CollectionID PS100001 -File .\ComputersToAdd.txt

Code Example

 

0

Tiny script to get the Computer name and Serial number from SCCM 2012

This script will connect to the Configuration Manger 2012 database and read the database tables to get information about computer clients and their serial number.

The script also gives the opportunity to search for a computer name by adding the serial number as an input or the other way around, get the serial number by adding the computer name as input.

To run the script successfully you need access to the Configuration Manager 2012 database. The script is provided at the end of this blog post.

screenshot

Powershell Script: GetSerialNumberInfo

2

Tiny SCCM 2012 script to get Devices in a Collection and the last Logged on user

This script will get all devices and last logged on user in a specified Collection.
Just run the script in a PowerShell prompt as bellow:

GetCollectionDeviceAndUser.ps1 –CollectionName <Name of a Collection>

Download the script: GetCollectionDeviceAndUser

0

Get clients partition information in SCCM 2012 with SQL query

If you ever have the need to look into the world of partitions on your clients with SCCM here is a way of doing it with SQL queries.

It could be that you need to know which clients that only have one partition or two partitions and so on. One reason could be that you need to know this before turning on BitLocker on your clients.

Below are some examples on the topic.

Counts the total amount of clients in the view V_GS_PARTITION.
SELECT COUNT(DISTINCT SystemName0)
FROM v_GS_PARTITION

Shows how many partitions every client has.
SELECT SystemName0, COUNT(*)
FROM v_GS_PARTITION
GROUP BY SystemName0

Shows how many partition one client has. Just change the “ComputerName1” to a name of a computer in your organization.
SELECT SystemName0, COUNT(*)
FROM v_GS_PARTITION
WHERE SystemName0 = ‘ComputerName1’
GROUP BY
SystemName0

Shows all partitions for a client. Just change the “ComputerName1” to a name of a computer in your organization.
SELECT *
FROM v_GS_PARTITION
WHERE SystemName0 = ‘ComputerName1’

Shows all clients that only have one partition.
SELECT SystemName0 AS [ComputerName], Count(*) AS [Number of Partitions]
FROM v_GS_PARTITION
GROUP BY
systemName0
HAVING COUNT(*) = 1

Thank you Jonas my colleague for the input on this topic!

0

Use the integrated MDT 2013 Execute Runbook task with SCCM 2012 together with Orchestrator using SSL

When using the SCCM 2012 integrated MDT 2013 Execute Runbook task together with an Orchestrator web service that are SSL encrypted one need to add this to the input. Below is an example how to add the port and https to get this to work.

https://OrchestratorServerName:<port>

The port at the end is only needed if not using the standard port 443 for SSL.

1