Mit der Application Catalog-Rolle bietet der Microsoft System Center Configuration Manager ab Version 2012 (SCCM) u.a. die Möglichkeit Anwendungen in einem recht einfach gestalteten Self-Service-Portal zur Verfügung zu stellen. Leider bietet die Rolle keine Funktion um den Administrator bei eingehenden Application Requests über E-Mail zu benachrichtigen. Abhilfe schafft dieses Powershell-Skript:
##################################################################### ### E-Mail-Notification for Application-Request in ConfigMgr 2012 R2 ### powered by Andre Picker - www.clientmgmt.de ### http://twitter.com/clientmgmt ##################################################################### ### E-Mail Settings ################################################# $SmtpServer = "smtp.contoso.com" $SenderMail = "configmgr@contoso.com" $TargetMail = "andre.picker@contoso.com" $Subject = "Application Catalog Request" $Message = "You have received a new Application Request from System Center Configuration Manager:`n" $Footer = "To process the request go to: \Software Library\Overview\Application Management\Approval Requests.`n`n*** This is an automatically generated email. Please do not reply to this message. ***" ### Interval ######################################################### $interval = $(Get-Date).AddMinutes(-60) ### Get SMS.Sitecode ################################################# $smsproviderloc = "select * from sms_providerlocation" $sitecode = Get-WmiObject -Query $smsproviderloc -Namespace "root\sms" -ComputerName localhost $sitecode = $sitecode.sitecode ### Query ############################################################ Get-WmiObject -Namespace "root\SMS\Site_$sitecode" -Class SMS_UserApplicationRequest | where {$_.CurrentState -match "1" -and [Management.ManagementDateTimeConverter]::ToDateTime($_.LastModifiedDate) -gt $interval} | Foreach-Object { $User = $_.User $Application = $_.Application $Comments = $_.Comments $Date = [Management.ManagementDateTimeConverter]::ToDateTime($_.LastModifiedDate) Send-MailMessage -From $SenderMail -Subject "$Subject from $User" -To $TargetMail -Body "$Message`nUser: $user`nApplication: $Application `nDate: $Date `nComments: $Comments `n`n$Footer" -SmtpServer $SmtpServer }
Das Skript kann im Task-Scheduler eingebunden und über folgenden Befehl aufgerufen werden:
powershell.exe -ExecutionPolicy Bypass -file "emailnotification.ps1"
E-Mail-Notification for Application Catalog:
Download: ConfigMgr: E-Mail-Notification for Application Catalog (TechNet Gallery)