PowerShell WPF Treeview example
Here is one simple PowerShell WPF Treeview example. You can use this example in different PowerShell tools. You can download the code from here [download id="168"]
Here is one simple PowerShell WPF Treeview example. You can use this example in different PowerShell tools. You can download the code from here [download id="168"]
I just published PoshCAT 0.2 version and the changes are as follows: · New Client Actions o Desired Configuration Manager Cycle o Application Machine Policy Cycle o Application Global Evaluation Cycle o Install ConfigMgr Client o Get App-V Client Packages o Get App-V Client Configuration o Get App-V Client Version o Enable App-V Client Package Scripts o Get ConfigMgr Client Available Applications o Get Applied Group Policies o Refresh Group Policies o Get Free Disk Space · Alternate Credentials Support – you can specify only one account · Active Directory Connector · Better error handling · Separate folder for reports [...]
You may want to read these posts before: · How to install PoshCAT · Building PoshCAT Part 1 – Create different Client Actions lists · Building PoshCAT Part 2 – Adding your own custom functions One of the most important thing you need to know before you start using PoshCAT is that it relies on PowerShell remoting. If you don’t configure PowerShell remoting on your computers, then the Client Actions will fail. In this post I will show how you can enable PowerShell remoting through Group Policy but you can also configure it manually. To enable PowerShell remoting manually you [...]
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 1 Function Get-ComputerAppliedPolicies 2 { 3 $GPOPolicies = @() 4 $GPOQuery = Get-WmiObject -Namespace "ROOT\RSOP\Computer" -Class RSOP_GPLink [...]
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 [...]
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!
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 - [...]
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 [...]
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 [...]
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
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. Function Create-Cred { Param( $Username, $Password ) Try{ $Pass = ConvertTo-SecureString $Password -AsPlainText –Force -ErrorAction Stop Try{ New-Object -typename System.Management.Automation.PSCredential -ArgumentList $Username,$Pass [...]
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 [...]
About two weeks ago I posted a PowerShell script that lists all the Collections Refresh date/time. Today I just posted another script to CM12SDK.net that lists all the Collections Maintenance Windows. You can create a CSV or an HTML report You can download this script from here
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
I just posted on CM12SDK.net a new PowerShell script that creates Collections based on Package/Application names. You can create Device & User collections with this script. You can download the script from here
My suggestion as best practice for inserting inputs into Run .Net Script
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
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 [...]
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 [...]
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
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
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
A powershell sample used at a customer for semi-automatically changing the Resolution States: Import-Module OperationsManager $Alerts = get-scomalert -ResolutionState 0 if ($Alerts) { foreach($Alert in $Alerts) { $newState = $null switch -wildcard ($Alert.Description) { "*Active directory*" { $newState = 10 } "*Exchange*" { $newState = 20 } "*DNS*" { $newState = 30 } "*Cisco*" { $newState = 100 } "*HP*" { $newState = 110 } "*Printer*" { $newState = 120 } "*EMC*" { $newState = 130 } "*RunAs*" { $newState = 200 } } switch -wildcard ($Alert.Name) { "Cannot start SQL Server Service Broker on Database" { [...]
Ever wondered where PowerShell ISE is located in windows 8?? this article also shows the new command browser feature