Scheduled PowerShell Task

I'd like to schedule a PowerShell task, have it pull 1 column of data from MySQL database and execute another PowerShell command on that data.  Is this possible?  Would you be kind enough to provide some sample code as I am new to both PS &
MySQL.
Or is it possible to schedule some sort of a job in MySQL to execute a PowerShell command?
Thanks!
www.ipUptime.net

Hi All. I have a problem. I have many .ps1 files in a directory. I have to execute them all with an scheduled task. But i don´t know how to do that cause all the info that I have found is to make a scheduled task with justo only one .ps1 file and I need
to execute more than one. Is there any way o do this??
Thanks all
Please start your own question instead of appending on to an old answered thread.
Short answer - yes. Write a caller script and just schedule the caller.
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing)

Similar Messages

  • Scheduled Powershell task not ending

    I've set up a PS script to email users who are with in 14 days of their password expiring.  When I run it in PS it's self it runs fine, the notices go out and it ends.  However when I set it as a scheduled task it doesn't stop.  It starts,
    sends the emails then Task scheduler says that it's still running an hour and a half later.  Normally it's a 5 min job.  I have it set to force stop after an hour, but it's ignoring that for some reason.  The job runs twice a day, and the action/program
    is set as "Powershell noprofile -noexit -executionpolicy bypass -file C:\PasswordNotification.ps1"
    THe scrip is as follows:
    # Version 1.1 May 2014
    # Robert Pearman (WSSMB MVP)
    # TitleRequired.com
    # Script to Automated Email Reminders when Users Passwords due to Expire.
    # Requires: Windows PowerShell Module for Active Directory
    # For assistance and ideas, visit the TechNet Gallery Q&A Page. http://gallery.technet.microsoft.com/Password-Expiry-Email-177c3e27/view/Discussions#content
    # Please Configure the following variables....
    $smtpServer="mail.forestriverinc.com.com"
    $expireindays = 14
    $from = "Password Notice <[email protected]>"
    $logging = "Disabled" # Set to Disabled to Disable Logging
    $logFile = "<D:\autoemail.csv>" # ie. c:\mylog.csv
    $testing = "Disabled" # Set to Disabled to Email Users
    $testRecipient = ""
    $date = Get-Date -format ddMMyyyy
    # Check Logging Settings
    if (($logging) -eq "Enabled")
        # Test Log File Path
        $logfilePath = (Test-Path $logFile)
        if (($logFilePath) -ne "True")
            # Create CSV File and Headers
            New-Item $logfile -ItemType File
            Add-Content $logfile "Date,Name,EmailAddress,DaystoExpire,ExpiresOn"
    } # End Logging Check
    # Get Users From AD who are Enabled, Passwords Expire and are Not Currently Expired
    Import-Module ActiveDirectory
    $users = get-aduser -filter * -properties Name, PasswordNeverExpires, PasswordExpired, PasswordLastSet, EmailAddress |where {$_.Enabled -eq "True"} | where { $_.PasswordNeverExpires -eq $false } | where { $_.passwordexpired -eq $false }
    $maxPasswordAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge
    # Process Each User for Password Expiry
    foreach ($user in $users)
        $Name = (Get-ADUser $user | foreach { $_.Name})
        $emailaddress = $user.emailaddress
        $passwordSetDate = (get-aduser $user -properties * | foreach { $_.PasswordLastSet })
        $PasswordPol = (Get-AduserResultantPasswordPolicy $user)
        # Check for Fine Grained Password
        if (($PasswordPol) -ne $null)
            $maxPasswordAge = ($PasswordPol).MaxPasswordAge
        $expireson = $passwordsetdate + $maxPasswordAge
        $today = (get-date)
        $daystoexpire = (New-TimeSpan -Start $today -End $Expireson).Days
        # Set Greeting based on Number of Days to Expiry.
        # Check Number of Days to Expiry
        $messageDays = $daystoexpire
        if (($messageDays) -ge "1")
            $messageDays = "in " + "$daystoexpire" + " days."
        else
            $messageDays = "today."
        # Email Subject Set Here
        $subject="Your password will expire $messageDays"
        # Email Body Set Here, Note You can use HTML, including Images.
        $body ="
        **THIS IS AN AUTOMATICALLY GENERATED EMAIL, PLEASE DO NOT REPLY**<br>
        <br>
        Dear $name,
        <p> Your Password will expire $messageDays.<br>
        <p>To change your password on a FR owned computer connected to the company network press CTRL, ALT, Delete and chose Change Password.<br>
        After your password has been changed please LOG OUT of citrix and windows and log back in using the new password.
        <p>For outside users, log into mail.Forestriverinc.com, and in the upper right corner select Options,
        then Change Your Password in the drop down menu, when the page loads enter your old and new password. <br>
        <p>Thank you, <br>
        <p>Forest River IT Dept.<br>
        <p>**DO NOT REPLY TO THIS EMAIL, THIS IS AUTOMATICALLY GENERATED**
        </P>"
        # If Testing Is Enabled - Email Administrator
        if (($testing) -eq "Enabled")
            $emailaddress = $testRecipient
        } # End Testing
        # If a user has no email address listed
        if (($emailaddress) -eq $null)
            $emailaddress = $testRecipient    
        }# End No Valid Email
        # Send Email Message
        if (($daystoexpire -ge "0") -and ($daystoexpire -lt $expireindays))
             # If Logging is Enabled Log Details
            if (($logging) -eq "Enabled")
                Add-Content $logfile "$date,$Name,$emailaddress,$daystoExpire,$expireson"
            # Send Email Message
            Send-Mailmessage -smtpServer $smtpServer -from $from -to $emailaddress -subject $subject -body $body -bodyasHTML -priority High  
        } # End Send Message
    } # End User Processing
    # End

    Hi,
    Rather than picking through your code, I figured I'd just post what I use:
    Import-Module ActiveDirectory
    $users = Get-ADUser -Filter * -Properties PasswordLastSet,EmailAddress -SearchBase 'OU=Users,DC=domain,DC=com' | ForEach {
    If ($_.PasswordLastSet -and $_.EmailAddress -and $_.GivenName -and $_.Surname) {
    If ($_.DistinguishedName -notlike '*,OU=System,*' -and $_.DistinguishedName -notlike '*,OU=Administrator,*' -and $_.DistinguishedName -notlike '*,OU=Shared Resources,*' -and $_.SamAccountName -ne 'thebigboss') {
    $passwordAge = ((Get-Date) - $_.PasswordLastSet).Days
    If ($passwordAge -ge 106) {
    If (120 - $passwordAge -ge 0) {
    $props = @{
    Name = $_.Name
    GivenName = $_.GivenName
    Surname = $_.Surname
    Username = $_.SamAccountName
    EmailAddress = $_.EmailAddress
    PasswordLastSet = $_.PasswordLastSet
    PasswordExpiresOn = (Get-Date $_.PasswordLastSet).AddDays(120)
    DaysRemaining = 120 - $passwordAge
    New-Object PsObject -Property $props
    } | Sort Name
    foreach ($user in $users) {
    $daysLeft = $user.DaysRemaining
    $emailBody = @"
    Hello $($user.GivenName),
    IMPORTANT REMINDER: Your *company* password will be expiring in $daysLeft days ($($user.PasswordExpiresOn.DateTime)).
    Please change your password at your earliest convenience.
    Procedure:
    1 - Press Control+Alt+Delete on your keyboard (or Control+Alt+End if connected via VPN).
    2 - Select 'Change a password...'.
    3 - Type your current password and your new password twice.
    4 - Press Enter or click the arrow button.
    If you have any questions, please contact the helpdesk: [email protected]
    Thank you.
    *company* IT Department
    If ($daysLeft -eq 14 -or $daysLeft -eq 10 -or $daysLeft -le 7) {
    Send-MailMessage -To $user.EmailAddress -From [email protected] -Subject 'Password Expiration Notification' -Body $emailBody -SmtpServer smtp.domain.com -Bcc [email protected]
    Send-MailMessage -To [email protected] -From [email protected] -Subject 'Password Expiration Notification Script Complete' -Body 'Script completed' -SmtpServer smtp.domain.com
    Scheduled Task Action Properties:
    Program/Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Add arguments: -File C:\Archive\Scripts\PasswordExpirationNotification\PasswordExpirationNotification.ps1
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Schedule a task for a given period of time

    Hi,
    any body has an idea how to schedule a task for a specified period of time. e.g A program keeps on asking for your name to be input for an hour and then start doing something else?
    /bob

    hi friend,
    Why don't you try using a TIMER. Try using this code
    Timer timer = new Timer((TIMER), new ActionListener()
         public void actionPerformed(ActionEvent ae)
    // perform your task here...
    timer.setInitialDelay(TIMER);
    timer.setRepeats(true);
    timer.start();
    I think this will work fine.
    Bye,
    Ravi.

  • Scheduling a task 1 year (365 days) out

    I am trying to schedule a task for 365 days out (1 year/52 weeks) and am encountering errors with the automatic scheduling. Work will be performed on the weekends, year-round, from 8:00 AM to 5:00 PM. I have set the "Change Working Time" options
    to consider the weekends working days, as well as set up my Scheduling default Options to: "Sunday week start"; "8 hour days"; "56 hours per week"; and "30 days per month".  However, when I enter 365 days under
    duration, the automatic scheduling is completely off.  Very frustrating... Please help!!

    Hi,
    I just ran a test and the task was scheduled accordingly
    What I have done was to set the Saturday and Sunday as working days in Change Working time
    if you are using 'days' to schedule your tasks, there is no need to change the other options (e.g. Hours per week)
    If you are assigning resources to your task, make sure the resource calendar is also having Saturday and Sunday as working days
    Hope this helps
    Paul

  • Scheduled Planner tasks and control validity

    Use case is outlined below:
    Local Control A is valid from 1/1/14 to 12/31/14. I'm trying to schedule a planner task with activity 'Test Control Effectiveness' for this local control. The task being scheduled is a recurring task starting from 1/1/15 to 1/1/17. As can be seen the planner task start date is post the 'Valid To' date of the control. So, essentially the control is not active during the duration for which the planner task is scheduled for. The system did not show an error message. Is this expected behavior? Also, even after I delete the scheduled planner task, I can no longer revise the 'Valid To' of the local control.
    I'd appreciate any document that outlines the pre-requisites for selecting object(s) within different planner tasks.
    Appreciate any help I can get with this!
    Thanks,
    Anju.

    I don't know what Control-M is, but if it can invoke a java task, then it can connect to OIM and start the scheduled task.
    A scheduled task doesn't have to be run within OIM. The scheduler within OIM simply provides a way to invoke the java code that performs tasks or Recons within OIM. So long as your system can run java to connect to OIM and run some code, you can run it in whatever way you'd like.
    -Kevin

  • Is there any utility in LabVIEW or LabVIEW add-on that does scheduling of tasks?

    I am trying to use LabVIEW to automate a process using various instruments. I need some utility that does the scheduling of tasks for me.

    Hi VipersView,
    What you are looking for is TestStand, which is the successor to the LabView TestExecutive toolkit. It is much easier to use and yet much more robust at the same time. You can create your test steps in virtually any language, including LabView G, C, C++, VB, Delphi, and so on. It also provides the ability to run tests on UUTs in parallel and as batches, while at the same time synchronizing the use of shared resources. TestStand is excellent for modularizing your automated test process and creating full test procedures that are adaptive and reusable.
    Here is the product page for TestStand, I highly recommend downloading the demo and looking at the tutorials and manuals for more info.:
    http://www.ni.com/teststand
    Jason F.
    Application
    s Engineer
    National Instruments
    www.ni.com/ask

  • Facility of Scheduling background tasks  in jdk1.2.2 as avb in jdk1.3

    JDK1.3 - java.util.Timer
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be scheduled for one-time execution, or for repeated execution at regular intervals.
    I want to know what is alternate to this in jdk1.2.2.
    I want to schedule teh tasks for thread to run in background in future using jdk1.2.2.

    Hello all,
    Is there a timer class that I can use for a stopwatch program for PersonalJava, which uses jdk 1.2.2? The java.util.Timer class is available starting with jdk 1.3. I've seen reference to a class called PTimer, but I can't find it. Nor can I find the pj.jar file which is supposed to contain PTimer.
    thanks,
    Harry Mitchell

  • PI - Schedule Configuration Task

    Good Morning,
    In Cisco PI 2.1 I would like to create a scheduled configuration task so that each evening PI saves the running-configuration of a switch to memory. I've created and deployed the template successfully however, I can't find a way to schedule this & I'd prefer not to have to login and deploy the template each day.
    Can anyone offer some advise on if this is possible?
    Thanks

    Hi Afroz,
    your suggestion refers to fetching the device configuration. I think that Michael is asking about scheduling a template deployment to a device. And this is what interests me also. There is no option to reuse a task which was scheduled and to make it run on a daily, weekly basis.

  • Scheduling a task on jsp

    Hi,
    I need help, i'm trying to schedule a task on jsp, but i have no idea how i can do it...
    I did this class:
    package util;
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.Calendar;
    import java.util.Date;
    public class Horas{
    Timer timer;
    Date time_fin;
    public void Programa(int periodo, Date inicio) {
      timer = new Timer();
      timer.schedule(new RemindTask(), inicio, periodo*1000);
    class RemindTask extends TimerTask {
      public void run() {
       Calendar fecha_actual = Calendar.getInstance()
       Date ahora = fecha_actual.getTime();
       if(time_fin.before(ahora))
        timer.cancel();
       else
        //  here goes the task
    public void setHorafinal(Date hora){
      time_fin=hora;
    }And from my jsp i call these methods using an useBean...
    <jsp:useBean id="sampleHorasid" scope="request" class="util.Horas" />
    <%
    sampleHorasid.setHorafinal(time_fin);
    sampleHorasid.Programa(10,time_ini);
    %>That works ok, but i want to write anything on the browser every time that invokes run()...
    It works if i put something like System.out.println(...); inside public void run(), but i want to write on the browser, not on console..
    Any idea about how can i do it?? :S
    Thanks!!!

    That works ok, but i want to write anything on the browser every time that invokes run()...
    It works if i put something like System.out.println(...); inside public void run(), but i want to write on the browser, not on console..
    Any idea about how can i do it?? :S
    An applet.
    The normal http request and response lifecyle does not allow you to push data arbitarily to the client browser. The only way you can write back to the browser is when it has sent a request to the server and you have a handle to the output response stream.
    cheers,
    ram.

  • Java Scheduling a task

    Hi,
    I would like to schedule a task in Java to be run for certain amount of time. I was going through Java Timer API, but could not find a way to run a certain task for X hours and then stop once the time has passed, or maybe I am misreading the API. Can anyone please help/suggest how to get this functionality. Any help will be appreciated.
    Thanks
    Mikkin

    The best idea off the top of my head is to have two TimerTasks. One is the task to be executed, and you schedule that to run in the future. The other TimerTask is to determine how long the task itself should run, and simply sets a flag that tells the other task to stop running and return. Basically the executed task should do something like the following pseudocode (as in the fact that runTimer probably doesn't care about how long it needs to run for, as that should be a job for the Timer itself):
    RunTimeTask runTimer = new RunTimeTask(360000); //Some custom class that hangs out for a determined time and then sets isTimeUp to true.
    while (!runTimer.isTimeUp()) {
         //doStuff
         Thread.yield();
    }It might not be the best way, and it might not fit the architecture of your system, but hopefully it will get you pointed in the right direction or get someone with more knowledge to come in here and be like "wtf is this" and tell you a better way. :D
    Edit: And yes, java.util.Timer is what you can use to schedule tasks to run in the future. Look at its methods.
    Edited by: ProjectMoon on Oct 5, 2009 2:02 PM

  • Scheduling a Task in Windows

    All,
    Can you please let me know if it is possible to schedule a task on a windows machine using a Signed Java Applet. If it is possible, can you please give me some pointers to the same and some code snippets? Thanks in advance! Have a great day!

    Hello Everyone,
    Succeeded !!!!!!!
    Even i was struggling with this same Problem to execute a batch via Window scheduler and set the setting to "Run whether the user is logged in or not".
    I tried many time but the batch runs with " Run
    whether user is logged on" and not with "Run
    whether user is logged on or not".
    what i discovered is that there was one mapped drive
    path in my batch file which was not the complete path like y:/AR.qvw actually what i did i changed that map path to the complete path like \\servnamename\d$\AR.qvw and the batch executed successfully with the setting "Run
    whether user is logged on or not"
    The
    conclusion is that check the dependency of the script on external resources because when you check this option "Run
    whether user is logged on or not" It actually conflicts. This my discovery.
    If
    you have any question write me on [email protected]
    Thanks
    & Regards,
    Arun

  • Windows Scheduled Maintenance Task

    I want to disable or delete the Windows Scheduled Maintenance Task in windows 7 by GPO in my domain 2012, because it delete old shortcuts in desktop users, but this task isn't in the c:\windows\tasks path, and I can't found it in the registry. Any idea?

    > I want to disable or delete the Windows Scheduled Maintenance Task in
    > windows 7 by GPO in my domain 2012, because it delete old shortcuts in
    > desktop users, but this task isn't in the c:\windows\tasks path, and I
    > can't found it in the registry. Any idea?
    Run
    schtasks /change /tn microsoft\windows\diagnosis\scheduled /disable
    in a startup script.
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • Server 2008 R2: Setting up a custom schedule with task scheduler

    I am trying to schedule a task using Server 2008 R2 Task Scheduler
    I've been googling and searching for an answer on how to do this. I could easily do it on Server 2003.
    I need to run a program (custom) that updates some tables in a database.
    I need to run it Monday thru Saturday at 20 minutes after the hour from 7:20 am through 5:20pm. Not on Sunday and not at night (only normal business hours)
    These are the steps I am following: I create task, General, I enter the description, Then triggers, new, select weekly, select start date and time, select the days I want (every day except sunday), repeat the task every hour, for a duration of (all I can
    choose is 12 hours).. This is where I am stuck. I guess I could choose 12 hours but I need it to stop at 5:20 pm not 7:20pm. Has anybody done something similar to this?

    Go ahead and choose something appropriate in dropdowns on Edit Trigger then over-type them with whatever you want.
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Scheduling a task with powershell

    Good morning,
    I have a powershell command that I want to schedule to run on Mondays and send an email to my email group, can someone assist me or provide a good resource to help out.
    The command is to search for uses who have been inactive for 30 days.
    Search-ADAccount -UsersOnly -AccountInactive -TimeSpan 30.00:00:00 | Where {$_.Enabled} | Sort Name | Get-ADUser -Prop DisplayName | Select Name,DisplayName | Out-File users.txt
    Chad

    I ran it in the run box, and this is what the output shows.
    The term 'Search-ADAccount' is not recognized as the name of a cmdlet, function
    , script file, or operable program. Check the spelling of the name, or if a pat
    h was included, verify that the path is correct and try again.
    At C:\temp\lastlogin.ps1:1 char:23
    + $body=Search-ADAccount <<<<  -UsersOnly -AccountInactive -TimeSpan 30.00:00:0
    0 |
        + CategoryInfo          : ObjectNotFound: (Search-ADAccount:String) [], Co
       mmandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    Send-MailMessage : Cannot validate argument on parameter 'Body'. The argument i
    s null or empty. Supply an argument that is not null or empty and then try the
    command again.
    At C:\temp\lastlogin.ps1:5 char:184
    + send-mailmessage -to "Systems Engineering <[email protected]>" -from
    "Inactive Accounts [email protected]" -subject "Accounts Inactive
    for at least 30 days" -body <<<<  $body -smtpServer relay.itserve.com
        + CategoryInfo          : InvalidData: (:) [Send-MailMessage], ParameterBi
       ndingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Power
       Shell.Commands.SendMailMessage
    Chad

  • System.Drawing.Bitmap in a scheduled powershell script

    I've written a powershell script to date stamp multipage tiffs, but I check to make sure the file name follows the correct format before doing so. The file name must contain the date, sequence number, and number of pages. The script works fine when run manually,
    but when run from task scheduler it fails to query the number of pages in the TIFF. Any ideas why the .NET features wouldn't work from a powershell script run as a scheduled task?
    I am putting the page number in the variable "count" by doing the following:
     $i=[System.Drawing.Bitmap]::FromFile($file.Fullname);$i.GetFrameCount($i.FrameDimensionsList[0]) 
     $count=$i.GetFrameCount([System.Drawing.Imaging.FrameDimension]::Page)
    FULL SCRIPT FOLLOWS
    #Define the input and output folders and date format
    $Original_TIFFs="C:\scans"
    $Modified_TIFFs=";\\test\Shared\SDS\"
    $date = get-date -Format d
    $datename=Get-Date -format yyyyMMdd
    Set-Location $Original_TIFFs
    #Configure email settings
    $emailFrom = "removed"
    $emailTo = "removed"
    $smtpServer = "removed"
    $body = "Rename scanned claims file to the correct format. This email was sent from: ", $env:computername
    #Define the location of the TIFF command line executable and its parameters
    $200DLL='C:\TiffDLL200Commandline\Cmd200.exe '
    $arg1='"FILE='
    #Modify arg2 to put the output directory in front of the ; if don't want to overwrite current file
    #$arg2=';|OW=Yes|BITS=2|TEXT=2;Received Date: '
    $arg2=$modified_TIFFs
    $arg3=';|BITS=2|TEXT=2;Received Date: '
    $arg4='|TEXTOPS=-5;;10;14;"'
    $files=Get-ChildItem $Original_TIFFs -Filter *.tif
    if ($files -eq $null)
      $subject = "No files to process today, directory empty."
      $smtp = new-object Net.Mail.SmtpClient($smtpServer)
      $body = "No files were processed today. This email was sent from: ", $env:computername
      $smtp.Send($emailFrom, $emailTo, $subject, $body)
    else
    foreach ($file in $files)                                                                  
       #Begin loop to check each file and process
     #Loads subsystems for opening TIFFs and second line puts the number of images into variable
     $i=[System.Drawing.Bitmap]::FromFile($file.Fullname);$i.GetFrameCount($i.FrameDimensionsList[0]) 
     $count=$i.GetFrameCount([System.Drawing.Imaging.FrameDimension]::Page)
     #If statement checks if filename format is correct
     if ($file -match '^\d{8}\d{3}_H_S_\d+_\d{8}[.tif]{4}$')
      $file.name -match '^(?<date1>\d{8})\d{3}_H_S_(?<page_count>\d+)_(?<date2>\d{8})[.tif]{4}$'   #Regex to put tests in $matches to check against
      if (($matches.date1 -eq $datename) -and ($matches.date2 -eq $datename))                      #Check if filename contains correct date
      if ($count -eq $matches.page_count)                                                          #Check if filename
    contains the correct page count
       #insert TIFF modification
        $allargs=$200Dll+$arg1+$file+$arg2+$file+$arg3+$date+$arg4
        cmd /c $allargs
        #cmd /c xcopy $file \\test\shared\SDS                                                   #Deprecated because now having
    TIFF200DLL create a new file rather than overwrite
        $i.Dispose()                                                                  
                #Close file stream so file can be deleted: http://support.microsoft.com/kb/814675
        Remove-Item $file.Name
        #Next section is for a different output directory; Setup a seperate batch file to delete original TIFFs in the middle of the night
        <#
        $allargs="cmd200 "+$arg1+$file+";"+$Modified_TIFFs+";"+$arg2+$date+$arg3
        cmd /c $allargs
        #>
        else                                                                    
                     #else statement to send out error message if the number of pages differs from name
        $subject = "The number of pages in the file ", $file.FullName, "differs from the actual count of ", $count, ". File will not be sent, please correct before tomorrow for processing."
        $smtp = new-object Net.Mail.SmtpClient($smtpServer)
        $smtp.Send($emailFrom, $emailTo, $subject, $body)
      }  #Close IF/THEN for correct date is in filename
     else
        $subject = "Date portion of filename is incorrect, please fix. File will not be sent to SDS", $file.FullName," ."
        $smtp = new-object Net.Mail.SmtpClient($smtpServer)
        $smtp.Send($emailFrom, $emailTo, $subject, $body)
     }                                                    #Close IF/THEN for initial filename check
     else
        $subject = "File does not meet proper naming convention and will not be stamped nor sent to SDS", $file.FullName, " ."
        $smtp = new-object Net.Mail.SmtpClient($smtpServer)
        $smtp.Send($emailFrom, $emailTo, $subject, $body)
    }                                                     #Close FOR loop
    }                                                     #Close Else for check if FILES=NULL

    You are buikding thisin the ISE?
    You need too add:
    add-type -AssemblyName System.Drawing
    ¯\_(ツ)_/¯

Maybe you are looking for

  • My itunes library/playlist has gone after i compressed the music folder unaware of flow on effect.

    Please hekp me reinstate my itunes library and playlists after my attempt to compress the windows music folder to save hard disk space. I have gone back to the music folder and unchecked the compression box and it looks like the music is reapperaing

  • Org Unit Field in IT 0001

    Hi Folks- The Org Unit field in IT 0001in PA is not capturing the ORG unit stored in OM.Integration is active between OM and PA currently.The Job and position fields are carrying over without any issues. Used RHINTE30- and the org unit is allready th

  • Adobe Edge will not download to a computer running XP

    Adobe Edge will not download to a computer running XP in case anyone is wondering. I just spent a frustrating hour finding this out the hard way. I do wish my cloud home page announced that face in big writing just above the Edge products that I coul

  • Output price variance calculation

    Hello, I have a question on output price variance calculation in SAP. The help reads: "Output price variances are reported in the following situations: If the standard price has changed between the time point of delivery to stock and the time point w

  • Streaming Photos Without SYNCing ????

    I would like to STREAM photos from my iMac to the Aplle TV without SYNC them. In other words I do not want them stored on the Apple TV. Someone told me I had to "pair" my Apple TV to my iMac for streaming. I do believe that yesterday I was 'streaming