Setting cowntdown in a Script
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!
April 6th, 2011 3:49pm
You want to use Start-Sleep
Free Windows Admin Tool Kit Click here and download it now
April 6th, 2011 4:04pm
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
April 6th, 2011 4:42pm
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
Free Windows Admin Tool Kit Click here and download it now
April 6th, 2011 9:36pm
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..
April 7th, 2011 8:14am