Announcement

Collapse
No announcement yet.

Require help on PS script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Require help on PS script

    Hello,

    We have 2007 exchange server and we used PS script for generate report and for other configuration and PS script is very used ful for fast output.

    But my query is that, is there any possibility for prompting option in PS script because each time I dont want to run same PS script so that time I need to change that script. I described my query with example as below.

    get-messageTrackingLog -sender '[email protected]' -start "07/16/2008 12:00 pm" -end "07/16/2008 02:00 pm"

    this command will return output for spatel user sending mail list between 12 to 2 pm. but this is for once, if I want to know about this user sending mail list between 2 to 4 pm then I need to change script or type commsnd manually.

    Is there possibel that we run messagetracking.ps1 file and it will prompt as below.

    c:\messagetracking.ps1
    sender:..................... after providing information press enter to jump next step
    start:......................... afer providing information press enter to jump next step


    So this type of functionality is available in Power Shell script

    If it will possible then too much helpful.
    MCITP - MCTS - MCSE

  • #2
    Re: Require help on PS script

    Not very good on PS "yet" so there are going to be much better ways of doing this but you could create a CSV file with the times in like this (asuming you can use 24hour clock)

    useremail,timestart,timeend
    [email protected],07/16/2008 12:00,07/16/2008 14:00
    [email protected],07/16/2008 14:00,07/16/2008 16:00
    [email protected],07/16/2008 12:00,07/16/2008 14:00
    [email protected],07/16/2008 14:00,07/16/2008 16:00

    then

    import-csv c:\test.csv | foreach { get-messageTrackingLog -sender $_.useremail –start $_.timestart -end $_.timeend }

    I just thought this off the top of my head so it may not even work, and I have no idea about the pause thing.
    cheers
    Andy

    Please read this before you post:


    Quis custodiet ipsos custodes?

    Comment

    Working...
    X