PowerShell script

Annulleret Opslået Nov 22, 2010 Betalt ved levering
Annulleret Betalt ved levering

Its processing into an html page. The dropdown Object that is needed to capture the "user's choice" is called SelectRM. From this choice the $[url removed, login to view] should be a variable depending on the choice.

Here is the code for the powershell script.

# Directory to scan

set-location "\\servername\MReport\SE"

$smtpServer = "[url removed, login to view]"

# Get all files that match the *.html pattern

# Filter that list to only files that have Archive bit set

# For each one of those found files.. send an email and set the archive bit

Get-ChildItem "*.html"| Where-Object { $[url removed, login to view] -match ".*Archive.*"} |ForEach-Object {

# Set up the .NET mail client objects

$text = [[url removed, login to view]]::readalltext($[url removed, login to view])

$regex = [regex]"selected=""true"" value=""\b[A-Z0-9._%+-]+@[url removed, login to view]"

$matches = $[url removed, login to view]($text)

$emailAdd = $matches[0]

if($emailAdd -ieq "") {

$regex = [regex]" selected value=\b[A-Z0-9._%+-]+@[url removed, login to view]"

$matches = $[url removed, login to view]($text)

$emailAdd = $matches[0]

}

$msg = new-object [url removed, login to view]

$att = new-object [url removed, login to view]($[url removed, login to view])

$smtp = new-object [url removed, login to view]($smtpServer)

# set the properties of the mail message

$[url removed, login to view] = ('$emailAdd')

$[url removed, login to view]("felicia@[url removed, login to view]")

$[url removed, login to view]("felicia@[url removed, login to view]")

$[url removed, login to view]("felicia@[url removed, login to view]")

$[url removed, login to view] = "Regional Report - Southeast Region"

$[url removed, login to view] = "You have received a new Regional Report"

$[url removed, login to view]($att)

# send that puppy along

$[url removed, login to view]($msg)

# Free the file so we can mod it

$[url removed, login to view]()

# now set the Archive bit

set-itemproperty $_ -name attributes -value ([[url removed, login to view]]::Normal)

}

There is an error:

CategoryInfo : ParserError: (true" value=`"\...]+@[url removed, login to view]":String) [], ParentContainsErrorRecordException

## Deliverables

It must call inside the html page the dropdown object id is called "SelectRM". The end user picks from selection, the C# page creates the html page and within the html page, already done, but you have to pull the name selected in the drop down from the html page.

Projekt ID: #3870641

Om projektet

Remote projekt Aktiv Dec 4, 2010