AzureAD/Intune – Add list of systems from CSV to Group with PowerShell

My work has been moving more and more into the cloud and making use of Intune. Recently, I was tasked with adding a large list of systems to a group in AzureAD for use in Intune. No one wants to do something like that manually, so I put together a script to do it for me.

I make use of two different PowerShell modules and you will need you AzureAD tenant ID, the object ID of the group along with rights to add to groups in AzureAD, and a CVS of the systems. I labeled the first row DeviceName.

Install-Module AzureAD
Install-Module msonline

$TenentID = <AzureAD tenent ID>
$groupID = <object ID of the AzureAd group> 
Connect-AzureAD -TenantId $TenentID
Connect-MsolService

$CHGList = Import-Csv -path <path to CSV>
Foreach ($Device in $CHGList)
{
$deviceadd = Get-MsolDevice -Name $Device.DeviceName | Select-Object -ExpandProperty ObjectID 
Add-AzureADGroupMember -ObjectId $groupID -RefObjectId $deviceadd
}   

ConfigMgr Run Script – Clear CM cache and BranchCache cache

We recently ran into some hash issues with content coming from BranchCache and wanted to clear out the cache on systems to wipe things clean so I did this quick script. I set the BranchCache part inside a comment block and used a # to comment out the comment block. This makes it so I could easily enable or disable the removal of the BranchCache part.

Continue reading “ConfigMgr Run Script – Clear CM cache and BranchCache cache”

ConfigMgr Content Source Breakdown Report

We recently start implementing BranchCache and PeerCache with ConfigMgr. I wanted to be able to report back to management where clients were getting content, how much was being downloaded, what the top content grabbed by source type, number of peer source by domain, boundaries missing PeerCache super peers, and peer content source counts by boundary. It is a lot of data and takes some time to run, but I felt the need to share my report with others.

RDL file is in my GitHub repository – https://github.com/NecroMonkey/vault/blob/master/SSRS-Reports/ContentSourceBreakdown/Content%20Source%20Breakdown.rdl

How to stay up to date with my posts

While the posts reside here, there are several ways to stay up to date.

  1. Just visit the blog on a regular basis at http://tech.necro-monkey.com or http://tech.michaelschultz.net
  2. On the left side of the blog, there is a way to subscribe and you will get emailed when a new post is made
  3. Follow my Facebook page at https://www.facebook.com/schultzsysadmin/
  4. Follow me on Twitter at @thenecromonkey
  5. I am also on LinkedIn at https://www.linkedin.com/in/michael-schultz-configman

Subscribe Now

I have added a subscription form to the sidebar for those that would like to be notified by email when I make a new post.  I may also send out the occasional newsletter or other such email, but I be spamming anyone or giving out your email addresses as I do not want people doing that to me.