This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pause/Wait in a script during deprovision?

Hi guys,

I'm currently running into an issue with one of my deprovision scripts. Basically, when a user gets deprod I have a series of scripts run that accomplish a bunch of different tasks. At the end of the depro, an email report is sent to IT stating what was done, and listing their current groups to confirm they were removed from all groups. I attempted to put a sleep command in at the beginning of the final script in order to give the groups time to propagate to all of our AD servers. Unfortunately using "start-sleep" doesn't actually seem to work. Am I crazy, or is there something else I could do in the deprovision scripts in order to get a sleep to work?

 

Here's a snippet of the script:

$logfile = "C:\Foo\$sam.txt"
"<b>START AD Profile Verification</b>`n<br /><ul>" | Out-File -FilePath $logfile -Append -NoClobber
"<li>Waiting 120 seconds for group propagation - $logDate</li>`n" | Out-File -FilePath $logfile -Append -NoClobber
Start-Sleep -s 120
"<li>120 seconds should have passed... - $logDate</li>`n" | Out-File -FilePath $logfile -Append -NoClobber

I've put the timestamp in to confirm whether or not the script is actually sleeping, I can confirm it just skips over the command, and does not actually wait the 120 seconds.

Parents
  • Kind of. You say you are executing multiple scripts during your deprovisioning - AR doesn't necessarily perform this serially.

    Object state management during automated processes in AR can be a tricky thing and sometimes requires you to drop flags on the object (i.e. into a virtual attribute) so you can tell which processes have executed and which have not.
Reply
  • Kind of. You say you are executing multiple scripts during your deprovisioning - AR doesn't necessarily perform this serially.

    Object state management during automated processes in AR can be a tricky thing and sometimes requires you to drop flags on the object (i.e. into a virtual attribute) so you can tell which processes have executed and which have not.
Children
No Data