Skip to content

Commit

Permalink
Create DeployUnlicensedSoftware.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
ayockel authored Jul 7, 2020
1 parent 2b5ccda commit f22f6c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DeployUnlicensedSoftware.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Import-Module D:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1

CD XXX:


$applications = get-cmapplication | Where-Object {($_.LocalizedDisplayName -like 'wks-ss*') -and ($_.LocalizedDisplayName -notlike '*licensed*')}

$alreadydeployed = Get-WmiObject -Namespace root\sms\XXX -ComputerName XXX -Query "select TargetName from sms_deploymentinfo where CollectionName = 'WKS-SS-Unlicensed Software'"

foreach($application in $applications){
if($application.LocalizedDisplayName -ne $alreadydeployed.TargetName){
Start-CMApplicationDeployment -Name $application.LocalizedDisplayName -CollectionName "WKS-SS-Unlicensed Software" -DeployPurpose Available -UserNotification DisplaySoftwareCenterOnly
}
}

0 comments on commit f22f6c4

Please sign in to comment.