Scripts

This page gives an overview of the different scripts and tools, which I’ve created and published lately. All the tools and scripts will show a (download) link and some basic information. The tools will also included a screenshot for a first impression.

RMDM_v12_CleanRemote Mobile Device Manager

This script creates a form to allow an administrative user, without access to a ConfigMgr Console, to retire, wipe, lock, pin reset and sync mobile devices.

RW_OverviewRetire/ Wipe a mobile device via (a) PowerShell (form)

This script creates a form to allow an user, without access to a ConfigMgr console, to retire and/ or wipe a mobile device.

This script creates a form that allows an user to search for the memberships of software updates to software update groups and deployment packages.
This script creates a form to allow an user, without access to a ConfigMgr console, to import computer Information and directly add a user device affinity/ primary user.
This script creates a form to show the collection details for a specific device. This includes information about the collections, deployments, variables, maintenance windows, power management and primary user.
This script creates a form to allow a user, without access to a ConfigMgr console, to approve, or deny, approval requests.
This script creates a form to show the collection membership(s) for a specific device.
This script creates a form that shows the applications that depend on a specific application. This includes the application name and deployment type of both.
Automagically set company as the mobile device owner via PowerShell and WMI

These scripts can be used to create a WMI event filter that finds newly created mobile devices, in ConfigMgr, and a WMI event consumer that responds by changing the device owner of the newly created mobile device.

Send Tweets via a PowerShell workflow

This PowerShell workflow needs a string as input and that specific string will be the tweet.

Get computer-targeted applications

This script dynamically creates task sequence variables for every application that is targeted at the device.

Get user-targeted applications

This script dynamically creates task sequence variables for every application that is targeted at the primary user of the device.

Add Updates to a Deployment Package via PowerShell

The script downloads the updates of the specified software update group (that are not downloaded, yet) to a temporary directory (C:\Temp) and then adds those updates to the specified deployment package.

This script allows you to change which package is linked to an automatic deployment rule.
This script allows you to change the site name of the specified site code.
This script contains a function that gets the location of an object in the console. It will simply output the folder location on screen.
This script contains a function that divides a collection into multiple (equally sized) smaller collections.
This script contains a function that creates a WqlQuerySetting and adds it to a configuration item.
The script will uninstall the Microsoft Intune client from a device.

Additional downloads

Besides scripts, I’ve also made a few other downloads available. Even though they’re not scripts, I would like to mention them on this page.

This PDF contains the content of the blog series that I did on windows-noob about how to setup a basic configuration of Microsoft Intune, integrated with System Center 2012 R2 Configuration Manager, in combination with and on-premises AD FS for a single sign-on experience.
This configuration baseline is created based on the information in the Windows Phone 8.1 MDM Protocal document and contains every mentioned setting for enterprise management.
This MOF file is created based on the information in the Windows Phone 8.1 MDM Protocal document and contains every mentioned setting for enterprise management.

Last updated: 19-12-2016

10 thoughts on “Scripts

  1. Hello, I tried running your “Import Computer Information via (a) PowerShell (Form)” script on a Windows Server 2008 R2 SP1 server running SCCM 2012 R2 CU3. I got errors regarding “Invalid Namespace” at root/SMS/site…. I noticed that this namespace does not exist. Some people say it should be root\cimv2\sms.

    Do you have a script that would work in this test environment please?. Could you point me in the right direction? I am new to PowerShell.

    Regards
    Adrian

  2. Hi Peter,

    Thanks so much for this valuable information and scripts. I used couple of script that you posted Wondering whether you can help me in script that I would like to create. I would like to get all collections details along with their deployment details. Let me know whether this is something that you can come up with.

    Thanks & regards,

    Vilas

  3. Hi Peter,

    I have already looked into Show Collection Details Tool. It’s wonderful tool. I was creating report (.csv) using PS to show all collections (even if they are empty) in a site and their deployments. I was able to do it thru SQL query. I went a step ahead and created a report using FULL JOIN to show ALL collections and ALL application details.

    Thanks.

  4. Peter,

    I am trying to use the
    Import Computer Information via (a) PowerShell (Form) directly from PowerShell on a 2012 R2 SP1 standalone site.
    I am using the following syntax directly on the site server: .\ShowCollectionDetails_v1_1p.ps1 -ResourceId 16777227 -SiteCode B01 -SiteServer SC2012R2CMMSDN.

    However, I get ‘Get-WmiObject: Invalid namespace “root/SMS/site_B01” error message. My sitecode is definitely correct, and when I use WMIExplorer to look at the root/SMS namespace, I don’t see anything like site_B01 or anything other site code. Any suggestions?

Leave a Comment