locked
Setting cowntdown in a Script RRS feed

  • Question

  • Hi!!

    I have to script some processes like enable mailboxes and then fill them with data. When I try to do this with a script  it looks like Exchange needs more time to process each cmdlet. For example, I enable all the mailboxes, then I fill all the data regarding "Organization" and sometimes I get things like "hey give me a break dude!! Can't find the mailbox yet!!"

      So, I was wondering if is there some way of setting a little countdown between one cmdlet and another, something like:

      Enable-mailbox -lalala

    Set-countdowntime - 10 sec

      Set-mailbox -Company "Company Inc." -department "Department of companies"

    Thanks in advance!

    Wednesday, April 6, 2011 7:41 PM

Answers

  • You want to use Start-Sleep

     

    Wednesday, April 6, 2011 7:57 PM
  • That's a known symptom can't really say if it's an issue or by design or AD replication. You can use the start-sleep or you can try to  specify the enable-mailbox -domaincontroller parameter to target the same DC that the Exchange server is using.

     


    James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com
    Wednesday, April 6, 2011 8:40 PM

All replies

  • You want to use Start-Sleep

     

    Wednesday, April 6, 2011 7:57 PM
  • That's a known symptom can't really say if it's an issue or by design or AD replication. You can use the start-sleep or you can try to  specify the enable-mailbox -domaincontroller parameter to target the same DC that the Exchange server is using.

     


    James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com
    Wednesday, April 6, 2011 8:40 PM
  • On Wed, 6 Apr 2011 19:41:59 +0000, Balzak Stingray wrote:
     
    >
    >
    >Hi!!
    >
    >I have to script some processes like enable mailboxes and then fill them with data. When I try to do this with a script it looks like Exchange needs more time to process each cmdlet. For example, I enable all the mailboxes, then I fill all the data regarding "Organization" and sometimes I get things like "hey give me a break dude!! Can't find the mailbox yet!!"
    >
    > So, I was wondering if is there some way of setting a little countdown between one cmdlet and another, something like:
    >
    > Enable-mailbox -lalala
    >
    >Set-countdowntime - 10 sec
    >
    > Set-mailbox -Company "Company Inc." -department "Department of companies"
     
    Use the "-domaincontroller <DC-Name>" on both of those cmdlets and use
    the same DC.
     
    Trying to use some delay in the processing is going to slow things
    down a lot because you'd have to wait for the maximum replication
    latency to ensure you had the data on all the DCs in the AD site.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Thursday, April 7, 2011 1:34 AM
  • Thanks everyone!

      Rich is right, but I I'm not planning to run this script so often so time, at this time, is not important and I tried to target directly to the DC but the results didn't went much more faster than without the -domaincontroller parameter. So I keep in mind both solutions!

    Best regards..

    Thursday, April 7, 2011 12:13 PM