Redistribute Package in Configuration Manager 2012

One pain point with Configuration Manager 2007, was that when a package failed to distribute content to a distribution point after the retry count was exceeded, it was permanently stuck in a distributing state. There was no easy supported method to redistribute that package to a specific Distribution Point. Now in 2012 we have the…

TechEd Australia 2013 – PowerShell for ConfigMgr 2012 SP1 – Demo 2

Demo 2: Connecting via PowerShell Importing the ConfigMgr module Import-Module ‘C:Program Files (x86)Microsoft Configuration ManagerAdminConsolebinConfigurationManager.psd1’ Connect to Primary Site (where PRI is the site code) Set-Location PRI: Display all Configuration Manager cmdlets Get-Command -Module ConfigurationManager Display a count of all the Configuration Manager cmdlets (Get-Command -Module ConfigurationManager).Count

TechEd Australia 2013 – PowerShell for ConfigMgr 2012 SP1 – Demo 4

 Demo 4: Packages Automatically create Package from source directory, create Deployment Type, create Collection and Deployment $ErrorActionPreference = “Stop” Set-Location C: $NewPackageLocation = “\TECHED13NewPackages*” $CorpSourcelocation = “\TECHED13Source$Packages” $NewPackageLocation = Get-Item $NewPackageLocation Copy-Item $NewPackageLocation -Destination $CorpSourcelocation -Recurse Remove-Item $NewPackageLocation -Recurse $PackageSourcePath = $CorpSourcelocation + ” + $NewPackageLocation.Name $SplitValues = $NewPackageLocation.Name.Split(“-“) $PackageManufacturer = $SplitValues[0] $PackageName = $SplitValues[1]…

TechEd Australia 2013 – PowerShell for ConfigMgr 2012 SP1 – Demo 3

 Demo 3: Collections Creating a single Collection New-CMDeviceCollection -LimitingCollectionName “All Systems” -Name “All Computers in 10.10.10.0” -RefreshType ConstantUpdate Creating a Collection Query Membership Rule for the above Collection Add-CMDeviceCollectionQueryMembershipRule -CollectionName “All Computers in 10.10.10.0” -QueryExpression “Select * from SMS_R_System where SMS_R_System.IPSubnets like ‘10.10.10.0’” -RuleName “10.10.10.0 Subnet Query” Source CSV file automated Collection creation NewMelbourneDCSubnets.csv (rename the…

TechEd Australia 2013 – PowerShell for ConfigMgr 2012 SP1 Content

Update: here is the video of my session (link below for full resolution video) https://channel9.msdn.com/Events/TechEd/Australia/2013/WCL416  Hello ConfigMgrDogs community. I’ve just completed my TechEd 2013 presentation – PowerShell for ConfigMgr 2012 SP1. For those who weren’t attending the event, I’ve provided all scripts and cmdlets from the session. In the coming weeks there will also be…

TechEd Australia 2013 – PowerShell for ConfigMgr 2012 SP1 – Demo 5

 Demo 5: App Approvals Script for System Tray notification, pop-up form and Approve/Deny an Application Approval Request Add-Type -AssemblyName System.Windows.Forms Import-Module ‘C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1’ Set-Location PRI:\ $ApprovalRequests = Get-CMApprovalRequest | Where{$_.CurrentState -eq 1} ForEach ($Approval in $ApprovalRequests) { function Popup-Form {  param ($form)                        $form.ShowDialog()     } $RequestUser = $Approval.User.TrimStart(“CONTOSO\”) $RequestApp = $Approval.Application…

TechEd Australia 2013 – PowerShell for ConfigMgr 2012 SP1 – Demo 6

 Demo 6: Five Demos in Five Minutes List the drivers in a given Boot Image $BootImage = $(Get-CMBootImage -Id “PRI00005”).ReferencedDrivers ForEach($Driver in $BootImage) {Get-CMDriver | Where{$_.ContentSourcePath -eq $Driver.SourcePath} | Select LocalizedDisplayName List all Collections with Incremental Collection Updates enabled Get-CMDeviceCollection | Where{$_.RefreshType -eq 6} | Select Name Clear Required PXE Deployments for a Collection Clear-CMPxeDeployment…