Home » Scripting »

Beyond unsupported – How to add PowerShell ISE to ConfigMgr Admin Console

As you already know, then currently we can only start PowerShell Console through Configuration Manager Admin Console but most likely  you may want to start PowerShell ISE through Admin Console Step-by-step guide First, this is not supported so don’t blame me if something is not working. Please also remember that there is no SAVE button […]

Category: Configuration Manager, Configuration Manager 2012 R2, Powershell, Scripting  |  1 Comment

Working with Queries in ConfigMgr with PowerShell

I accidentally blew up my dev lab and now I need to build a new one but luckily we have PowerShell :). In this picture we have 8 Queries and I would like to create Device Collections based on these Queries. These Queries are built with Servicing Extension.   Here are some of the commands […]

Category: Configuration Manager, Configuration Manager 2012 R2, Powershell, Scripting  |  2 Comments

Quick intro to Configuration Items in ConfigMgr with PowerShell

Configuration Items that I would like to export and import   Here are some command examples that we can use in Configuration Manager 2012 R2 CU4. #Import Module Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1") $SiteCode = Get-PSDrive -PSProvider CMSITE Set-Location "$($SiteCode.Name):\" #Get all CIs $ConfigurationItems = Get-CMConfigurationItem #Total CIs $ConfigurationItems.Count #Get CIs only with specific keyword $ConfigurationItems = Get-CMConfigurationItem […]

Category: Configuration Manager, Configuration Manager 2012 R2, Powershell, Scripting  |  Comment

New ConfigMgr PowerShell cmdlets in CU4

Microsoft just released a new CU for Configuration Manager and with latest CU we got 35 PowerShell cmdlets. Now we have 597 PowerShell cmdlets. Here are the new ones: Add-CMDeploymentTypeDependency Add-CMDeploymentTypeSupersedence ConvertFrom-CMApplication ConvertFrom-CMConfigurationItem ConvertTo-CMApplication ConvertTo-CMConfigurationItem Get-CMCertificate Get-CMClientOperation Get-CMDeploymentTypeDependency Get-CMDeploymentTypeDependencyGroup Get-CMDeploymentTypeSupersedence Get-CMMigrationSource Get-CMObjectSecurityScope Get-CMQuery Get-CMSiteRole Invoke-CMGroupDiscovery Invoke-CMQuery Invoke-CMSystemDiscovery Invoke-CMUserDiscovery New-CMADGroupDiscoveryScope New-CMDeploymentTypeDependencyGroup New-CMEmbeddedObjectInstance New-CMEmbeddedProperty New-CMEmbeddedPropertyList New-CMQuery Remove-CMCollection […]

Category: Configuration Manager, Configuration Manager 2012 R2, Powershell, Scripting  |  2 Comments

Create ConfigMgr Collections and Admin Console Folders with PowerShell

Starting from ConfigMgr 2012 R2 we can use New-Item PowerShell cmdlet to create ConfigMgr Admin Console folders. Here is one simple and quick PowerShell script that allows you to create folders and Collections and finally it moves the Collection to correct folder. #Step 1 Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1") $SiteCode = Get-PSDrive -PSProvider CMSITE Set-Location "$($SiteCode.Name):\" #Step 2 […]

Category: Configuration Manager, Configuration Manager 2012 R2, Powershell, Scripting  |  3 Comments

Create Shortcut With Elevated Rights

How do I create a shortcut that runs as Administrator?

Category: Powershell, Scripting, Software distribution, Tips and tricks  |  1 Comment

Service Manager powershell snippets

Merry x-mas! In today’s December calendar tips & trick I’m going to a post some useful powershell snippets for Service Manager. As we all know, the December 11th is the special day where the Bethlehem-powershell star outshined all the others.        The scripts here is mostly for administrative purposes. They are of course […]

Category: Administration, Management Packs, Powershell, Service Manager  |  Comment

Get Direct Collection Memberships And Machine Variables Information

On several occasions I have had the need to pull information on SCCM devices, and recently I was asked to do a backup of all client direct memberships and some specific machine variables. So I thought I would share my latest version of a script that does that. The script takes an argument that will […]

Category: Configuration Manager 2012, Configuration Manager 2012 R2, Powershell, Tips and tricks  |  Comment

How to populate object properties with data from a database using PowerShell

  You probably know how you can use a registry discovery to populate properties on windows computer instances, but what if you already have the data in SQL database/CMDB and want to avoid having to first write the data to the registry and then use a discovery to get the data into SCOM? Or what […]

Category: Powershell, SCOM  |  Comment

Measure Mail/SMTP Round Time from SCOM

Have you ever thought about how to measure the actual SMTP/Mail round time on your Mail installation? And have you tried to configure the Exchange MP for external mail bounce without any luck? Its differcult… The solution we did for a customer was first of all to ensure the customer have Exchange on-prem, next develop […]

Category: Operations Manager 2012 R2, SCOM, Scripting, VBScript  |  2 Comments