Building PoshCAT Part 2 – Adding your own custom functions

Last week I showed how you can create different Client Actions lists for different support groups in your organization and in this post I will show how you can add/create your own custom functions for PoshCAT So let’s assume that you would like to query applied Computer Group Policy objects. If you want that your custom function returns some kind of information, then it must return PSObject. Here is the function that I use in this example. This function queries only applied/enabled policies [crayon-5b4ff30ddaa0c461833843/] This function creates the following output To add this function to PoshCAT 1. Open WorkerFunctions.ps1 file [...]

Building PoshCAT Part 1 – Create different Client Actions lists

Last week I published our new tool PoshCAT and in the upcoming weeks I will cover different things. In this blog post I will show how to create different Client Action lists for different support groups. PoshCAT uses XML based configuration file for different Client Actions that you can execute through UI. One of the main ideas was that the tool should be customizable: · Ability to add and remove commands from UI · Ability to add your own custom actions/functions By default there are over 30 commands that are ready for use. Commands.xml configuration · TASK – Client Action [...]

How to install PoshCAT

1. Download and Unzip PoshCAT_v0.2.zip 2. Right-Click Start-PoshCAT.ps1, WorkerFunctions.ps1, SharedFunctions.ps1 and Commands.xml and select properties. 3. Unblock the files if needed and click OK. 4. Right-click Start-PoshCAT.ps1 and choose Run with PowerShell 5. If you don’t have administrative permissions, this message will be shown.   Enjoy!

SCCM Client Actions Tool PowerShell Edition aka PoshCAT

Updated 28.08.2013 Description SCCM Client Actions Tool PowerShell Edition aka PoshCAT is a practical and simple PowerShell application for performing most common day-to-day administrative tasks on System Center 2012 Configuration Manager Clients. The tool allows running actions remotely on one or more computers simultaneously. A list of computers can be provided either from a file (CSV, TXT) or loaded from Configuration Manager Collection importer or through Add Computer prompt. You can find the old version from here SCCMCAT - https://sccmcat.codeplex.com/ by Christjan Schumann. Please read the documentation first and blog posts! Please read this post how to install PoshCAT - [...]

New Tool – Coretech APP-V Package Analyzer and Converter

APP-V 5 has been around more than one year now and if you have a lot of old APP-V 4.5 or 4.6 packages then you may want to move to newer version to get all the nice features that APP-V 5 provides. APP-V 5 Sequencer PowerShell Module contains Test-APPvLegacyPackage and ConvertFrom-AppvLegacyPackage CMDLETs. Test-AppvLegacyPackage CMDLET allows us to analyze old packages and if the analyzer says no problem, then we can convert the old apps to never version with ConvertFrom-AppvLegacyPackage CMDLET. I got 61 old APP-V packages last week and I wanted an easy way to analyze these packages and also [...]

Coretech WMI and PowerShell Browser

I´m happy to announce our first version of WMI and PowerShell Explorer tool. The main reason why I did this tool is to simplify my own work and hopefully, it will help others also who are working with Configuration Manager. Description · Coretech WMI and PowerShell Explorer is a freeware tool with two main feature sets. · A powerful WMI tool that allows you to connect to and work with WMI locally and remotely. With the tool you can browse WMI namespaces, classes, methods, properties and class instances. Besides being a WMI browser the Coretech WMI and PowerShell Explorer allows [...]

REPORT: List different Configuration Manager Packages Distribution Point Refresh dates

If you are looking a PowerShell script that can list Distribution Point Refresh Schedule dates for different content types like packages, software updates, images, boot images, driver packages, then stop looking :). I just posted a new PowerShell script on CM12SDK.net that can create these reports for you. This script can create CSV and HTML reports. You can download the script from here

By | 2013-06-13T13:30:50+00:00 June 13th, 2013|Powershell, Scripting & Development|0 Comments

PowerShell Splatting – Nice way to simplify your scripts

Currently I´m building PowerShell WMI Explorer and because of this tool supports alternate credentials, then I thought how can I simplify my Get-WmiObject queries and the solution is Splatting :) PowerShell splatting allows you to create Function or CMDLET parameters dynamically. Below example shows how you can build dynamically Get-WmiObject parameters. You can use this script to query WMI information from the local machine or from the remote computer and if necessary you can also add alternate credentials. [crayon-5b4ff30dddd53284989595/]

By | 2013-06-08T10:58:54+00:00 June 8th, 2013|Powershell, Scripting & Development|0 Comments

PowerShell: Disable Automatic Loading of Modules in PowerShell 3.0

  One of the new features in PowerShell 3.0 is the Auto Loading of Modules. This feature is great for discovering commands, but can be really annoing when trying to test if your script works as it is supposed to. Luckily we can change the settings using an automatic variable. $PSModuleAutoloadingPreference Here is the info from the help: $PSModuleAutoloadingPreference------------------------------      Enables and disables automatic importing of modules in the session.       "All" is the default. Regardless of the value of this variable, you      can use the Import-Module cmdlet to import a module.      Valid values are:        All    Modules are imported automatically on [...]

Take control of your ConfigMgr Collections part 1

If you are managing a large ConfigMgr environment, then it is important to know when your collections updating their memberships and if your collections are updating exactly the same time, then it may hit your SQL very badly. This script reads all the collections and you can specify which output you want – CSV or HTML. You can download the script from here

System Center 2012 Configuration Manager SP1 Cumulative Update 1 PowerShell Parameter Sets Excel Sheet

I just updated the SP1 RTM version of Configuration Manager 2012 SP1 RTM PowerShell Parameter Sets Excel sheet and with SP1 CU1 we have 511 CMDLETS and 1675 parametersets :)   You can download the Excel Sheet from here Happy Scripting Kaido    

PowerShell – How to do WMIClass CreateInstance but WITH credentials

Today I was building a script to create system resources in SCCM 2012 and part of the task was to add these resources to a set of collections. The script will use from the SCCM server when finally implemented but for now I was using my laptop for editing and debugging. When I came to the point where I had to create the actual membership rules for the collections I ran into a hurdle that puzzled me. The WMI object I had to create was the SMS_CollectionRuleDirect, which often is done using this simple PowerShell snippet: $ruleClass = [WMICLASS]"\\$($server)\root\sms\site_$($sitecode):SMS_CollectionRuleDirect".CreateInstance() And [...]

PowerShell to the rescue – Clean up direct collection memberships

We where talking to a customer about how to avoid waiting for Active Directory group synchronization to occur and place a device in the correct collections faster than “until the next synchronization”. The main problem with this setup was caused by the fact that they used a group-in-group membership to identify collection memberships and apparently SCCM 2012 don’t include indirect changes to group membership as delta changes (I have not tested this in details yet). So we came up with the idea to just create a direct membership to place the device in the collections instantly to make sure that [...]

By | 2013-03-12T12:31:15+00:00 March 12th, 2013|Configuration Manager (SCCM), Powershell|3 Comments

How can I determine what Antimalware Policy is applied to my SCEP 2012 SP1 client

Niall Brady posted a blog post a few days ago How can I determine what Antimalware Policy is applied to my SCEP 2012 SP1 client. Niall showed how to check Antimalware Policy via registry or via Configuration Manager Console. Actually there is one method more - Antimalware policy is also stored in WMI class . You can use query below to identify the Antimalware policy from WMI. $EmptyPolicy= @() $EPPolicy = Get-wmiObject -namespace "Root\ccm\Policy\Machine\ActualConfig" -query "Select Name from CCM_AntiMalwarePolicyClientConfig" | ForEach-Object {$EmptyPolicy+=$_.Name} $EmptyPolicy | Group-Object | Select-Object -Property Name -Unique   Script Output  

By | 2013-02-22T18:53:09+00:00 February 22nd, 2013|Configuration Manager (SCCM), Powershell|1 Comment

CSV REPORT: Get ConfigMgr Collection Excluded or Included Collection Rules

Currently there should be no builtin report that will show you Excluded or Included collections and because of that I did two simple PowerShell scripts that queries Included or Excluded collections. Both of these scripts creates a CSV file. You can run this script on your Primary, CAS or Central site like this: Get-CMCollectionExcludedCollectionRules.ps1 -SiteCode PS1 -SiteServer Localhost -OutPut c:\Temp\ExcludedCollectionReports.csv Get-CMCollectionIncludedCollectionRules -SiteCode PS1 -SiteServer Localhost -OutPut c:\Temp\IncludedCollectionReports.csv Get-CMCollectionIncludedCollectionRules.ps1 Get-CMCollectionExcludedCollectionRules.ps1 Example Output  

By | 2013-01-31T14:47:18+00:00 January 31st, 2013|Configuration Manager (SCCM), Powershell|1 Comment

Quick and Dirty Management Point check

If you have a big Configuration Manager environment and you don´t have a monitoring solution like SCOM or NAGIOS, then PowerShell can help you too.  This script queries all Management Points from SMS_SystemResourceList WMI class and it will check MPCERT and MPLIST website status. If you want to use this script then run it on your Central, CAS or Primary Site Server like this: Get-CMSMPStatus.ps1 -SiteCode PS1 -SiteServer Localhost -OutPut c:\Temp\MPStatus.csv. This will create a CSV Report (example below) This script should work with PSH v2 and v3. You can download the code example from here

By | 2013-01-29T14:20:44+00:00 January 29th, 2013|Configuration Manager (SCCM), Powershell|2 Comments

Powershell to change Resolution State in Operations Manager 2012

A powershell sample used at a customer for semi-automatically changing the Resolution States: [crayon-5b4ff30ddf228021355905/] [crayon-5b4ff30ddf231514954206/] [crayon-5b4ff30ddf237366194944/] [crayon-5b4ff30ddf23c147586113/] [crayon-5b4ff30ddf241229491535/] [crayon-5b4ff30ddf245357327947/] [crayon-5b4ff30ddf24a643344337/] [crayon-5b4ff30ddf24f031540436/] [crayon-5b4ff30ddf254177118597/] [crayon-5b4ff30ddf259541546844/] [crayon-5b4ff30ddf25d596434639/] [crayon-5b4ff30ddf262901979159/] [crayon-5b4ff30ddf267875711498/] [crayon-5b4ff30ddf26c291889539/] [crayon-5b4ff30ddf271920874865/] [crayon-5b4ff30ddf276753587213/] [crayon-5b4ff30ddf27a930117854/] [crayon-5b4ff30ddf27f745943864/] [crayon-5b4ff30ddf284384300815/] [crayon-5b4ff30ddf288315641723/] [crayon-5b4ff30ddf28d967503814/] [crayon-5b4ff30ddf292026642646/] [crayon-5b4ff30ddf296001974042/] [crayon-5b4ff30ddf29b987277557/] [crayon-5b4ff30ddf2a0912747750/] [crayon-5b4ff30ddf2a5421849204/] [crayon-5b4ff30ddf2aa647841044/] [crayon-5b4ff30ddf2af486753239/] [crayon-5b4ff30ddf2b3161807987/] [crayon-5b4ff30ddf2b8968052065/] [crayon-5b4ff30ddf2bd989151860/] [crayon-5b4ff30ddf2c2211386867/] [crayon-5b4ff30ddf2c6735307386/] And have a great Day Kåre

By | 2017-08-22T13:05:40+00:00 November 13th, 2012|Automation, Operations Manager (SCOM), Powershell|3 Comments

Eject CD script, quarantined by FEP! PowerShell to the rescue!

I guess everyone knows that you can’t enable BitLocker on a machine from a Task Sequence if there is a CD in the CD drive… The workaround is quit simple, just run a script to eject the cd drive before running the “enable BitLocker” step. Well the other day this script, a vbs, I use, was removed by Forefront.. I guess the heuristic scan evaluated the content of the script to be unsafe, and quarantined it.. This is obviously not good, as it’s needed by the task sequence… So I thought, maybe there is a way to eject the CD [...]

By | 2012-03-22T12:25:53+00:00 March 22nd, 2012|General info, OS Deployment, Powershell, Security|3 Comments