PowerShell add Computers to Collection from CSV – SCCM ConfigMgr

This is a quick and dirty PowerShell script to import from CSV using the name of the machine to find the resource ID. It will only work for machines that are already a member of the Site you are working on.

For example you could use one of my other scripts to export from one collection and then add to a new collection.

As always this is provided as is, usage is in the header and please use the modded by field 😉

Set IP during Task Sequence PowerShell – SCCM ConfigMgr MDT

So this Is an older script of mine that I developed for a client to receive variables from a task sequence and then assign the IP of the machine based off the variables. This specfic client set the IP variables on the actual Machine object in SCCM so that during the task sequence it would pull the machine specific IP details. Their Task seqeunce was running only ConfigMgr tasks but this could quite easily be re-used for a ConfigMgr / MDT task sequence using the custom settings or database to set the IP Variables.

As always this is as is, the usage is defined in the script header and if you do use it please remember to use the modded by field 🙂

PowerShell Add Variables to Machines from CSV SCCM ConfigMgr

So it used to be a bit trickier to add a custom variable or multiple variables to a machine object in SCCM/ConfigMgr. But since the addition of the awesome New-CMDeviceVariable Cmdlet it’s a breeze!

Basically I’m in the midst of automating a clients Server Builds. As they have a lovely spreadsheet with all details of each server I thought I’d nock this up as a starter this evening.

So the script imports the CSV specified and from there creates the variables supplied in the CSV to the machine that is named in the CSV (that’s a lot of CSV). If the script cant find the Machine object (say you are doing hundreds or thousands!) that is named in the CSV file it will log that name to a text file called “NotFound.txt” in the script root folder.

As always comments throughout the script explain every step.

Anyway here is the script and CSV example:

CSV:

PowerShell Export Collection Members to CSV SCCM ConfigMgr

I was at a client’s yesterday and wanted to “True Up” SCCM/ConfigMgr’s Collection memberships compared to a spread sheet they had of their servers. Now I’m not an Excel wizard by any stretch of the Imagination! So the client said “Can you get me a CSV with the server names listed”.

The next thing that happened is bellow! It’s really quite a simple script when you think about it. As always comments throughout the script explain what is happening.

Anyway here it is:

Copyright 2016 SCCMOG | All Rights Reserved