Disclaimer: We hope that the information on these pages is valuable to you.
Your use of the information contained in these pages, however, is at your sole risk.
All information on these pages is provided "as -is", without any warranty, whether express or implied,
of its accuracy, completeness, fitness for a particular purpose, title or non-infringement,
and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by site owners or operators.
Further, the site owners and operators shall not be liable for any damages you may sustain by using this information,
whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.
Warning: main(/home/prosphot/public_html/smog/track/write_logs.php) [function.main]: failed to open stream: No such file or directory in /home/prosphot/public_html/blog/skins/leaf/footer.php on line 3
Warning: main(/home/prosphot/public_html/smog/track/write_logs.php) [function.main]: failed to open stream: No such file or directory in /home/prosphot/public_html/blog/skins/leaf/footer.php on line 3
Warning: main() [function.include]: Failed opening '/home/prosphot/public_html/smog/track/write_logs.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/prosphot/public_html/blog/skins/leaf/footer.php on line 3
Mon 06.02.08: Run Script as at job to disable terminated users mailboxes.
We have a procedure where after a user is terminated their AD User object is moved into a terminated users OU. Then they are removed from all security/distribution groups.We needed a way to have their Mailbox disabled as well. So we setup a at script that does this.
To run the script, you need to use the following command:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -command ". 'C:\ps-scripts\terminated_users.ps1'”
This will runn the script termiated_users.ps1 as an Exchange PowerShell script.
Here is what the termiated_users.ps1 script contains:
get-mailbox -OrganizationalUnit "myfamily.int/Corp/Users/Terminations" | disable-mailbox -WhatIf
Basically the script grabs all the mailbox objects in the Terminations OU, then disables them. You will want to remove the -WhatIf after you verify that it is only affecting the accounts you want affected.
Item Rating Information....