Jump to content


ABNOTECHGUY

Established Members
  • Posts

    1
  • Joined

  • Last visited

About ABNOTECHGUY

  • Birthday 10/29/1976

Profile Information

  • Gender
    Male
  • Location
    Brisbane
  • Interests
    All things System Center

ABNOTECHGUY's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I hope that someone is still monitoring this thread. I'm experiencing the exact same issue as 'lucastee' but there is no actual resolution mentioned so I'm at a loss as to how to fix this issue. I have tested using the same method. Created vbscript to send email and it worked fine but I'd like to use powershell. Seems like there is some sort of permission or something that will not allow powershell to be run from the status filter action field. Here is the syntax I've been trying: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -file "D:\OSP\Scripts\Powershell\OSDFailed.ps1" -argumentlist "%msgsys, OSD - Install Corporate SOE Test'" The script itself requires two variables which I've defined on the command line as %msgsys and "OSD - Install Corporate SOE Test I'm using Michael Niehaus' custom powershell module that is being called using a default profile in the C:\Windows\system32\WindowsPowerShell\v1.0 directory so that it applies to all profiles and this is where I'm not sure if there is some issue with the system account or what ever account runs the status filter action is not loading the module. According to my statmgr.log file the process runs and exits cleanly, but no email is sent: Created child process 2408 for program "C:\Windows\System32\WINDOW~1\v1.0\powershell.exe" and command line arguments "-file "D:\OSP\Scripts\Powershell\OSDFailed.ps1" -argumentlist "BGCB62S, OSD - Install Corporate SOE Test" The process exited with exit code 0. Here is the code of my powershell script (*server names changed): param([string]$strComputerName, $strSequenceName) $strSCCM = Connect-SCCMServer -HostName SERVER -siteCode A00 #-credential $cred $strPCinfo = Get-SCCMComputer -SccmServer $strSCCM -NetbiosName $strComputerName $strSite = $strPCinfo.ADSiteName $strOSType = $strPCinfo.operatingSystem.Caption # Check that value exists for $strSite If(!$strSite) {$strSite = "Could not determine site"} # Asia sites ElseIf($strSite -eq "Shanghai") {$strSLShare = "SERVERNAME"} ElseIf($strSite -eq "Mongolia-UHG") {$strSLShare = "SERVERNAME"} ElseIf($strSite -eq "Ulaanbaatar") {$strSLShare = "SERVERNAME"} ElseIf($strSite -eq "Beijing") {$strSLShare = "SERVERNAME"} # South America sites ElseIf($strSite -eq "Santiago-Chile") {$strSLShare = "SERVERNAME"} # South Africa sites ElseIf($strSite -eq "Johannesburg") {$strSLShare = "SERVERNAME"} ElseIf($strSite -eq "Boseto") {$strSLShare = "SERVERNAME"} # Australian sites ElseIf($strSite -eq "Perth-170") {$strSLShare = "SERVERNAME"} Else {$strSLShare = "SERVERNAME"} #Set Report ID If($strSequenceName -eq "OSD - Install Corporate SOE") {$strReportID = "A0000032"} If($strSequenceName -eq "OSD - Install Corporate SOE Test") {$strReportID = "A0000031"} Send-MailMessage ` -SmtpServer "SERVERNAME" ` -to "SCCM Mail <EMAILADDRESS>" ` -From "SCCM OSD <EMAILADDRESS>" ` -Subject $strComputerName": OS Deployment Failed" ` -body @" <style type="text/css"> /* Makeshift CSS Reset */ { margin: 0; padding: 0; } /* Tell the browser to render HTML 5 elements as block */ header, footer, aside, nav, article, div { display: block; } body { text-align: center; margin: auto; width: 800px; font: 13px/22px Arial, Helvetica, sans-serif; } h1 { font-size: 28px; } h2 { font-size: 22px; } strong { color: #003366; } p { margin-bottom: 5px; } td { text-align: left; } table { margin: auto; } #intro { margin-bottom: 20px; padding: 20px; background-color: #232135; background-size: 100%; border-radius: 22px; height: 50px; } #blogpost { font-size: 16px; margin-bottom: 20px; padding: 20px; background-color: #EBEBEB; background-size: 100%; border-radius: 22px; color: #333; } #resultcolor { color: #FF0000; } #colorchange { color: #4F81BD; } #footersub { color: #808080; } </style> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <header> <h1>CORPORATE OSD RESULTS</h1> </header> <div id="intro"> <h2 id="resultcolor">DEPLOYMENT ERROR</h2> </div> <div id="blogpost"> <p>The Operating System Deployment Task Sequence <br/><strong>$strSequenceName</strong><br/> has encountered a problem installing Windows<sup style="font-size:11px">©</sup><br/><br/> Computer Name: <strong>$strComputerName</strong> | Site: <strong>$strSite</strong> | Time: <strong>$strTime</strong></p> </div> <div> <p>Please use the links below for troubleshooting issues:</p> <table> <tr> <td><b>STATUS REPORT:</b></td> <td> </td> <td> <a href="https://SERVERNAME/Reports_SCCM2012R2/Pages/Report.aspx?ItemPath=%2fConfigMgr_A00%2fSoftware+Distribution+-+Package+and+Program+Deployment+Status%2fAll+system+resources+for+a+specified+package+and+program+deployment+in+a+specified+state">Status Report Page</a></td> </tr> <tr> <td><b>BUILD LOGS:</b></td> <td> </td> <td> <a href="file://\\$strSLShare\BuildLogs\$strComputerName">$strComputerName Log Directory</a></td> </tr> </table> </div> <div> <!-- Footer --> <hr/> </div> </body> "@ ` -BodyAsHtml
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.