Auto create users email
looking for help creating a script that will look in a OU, for new users and create a email account for any new users listed in that OU...
so far ive been stairring at Enable-mailbox cmdlet for a while trying to decipher this cmdletTwitter: @dguilloryjr LinkedIn: http://www.linkedin.com/in/dannyjr Facebook: http://www.facebook.com/#!/dguilloryjr
June 25th, 2012 10:34am
Hi,
The below will mailboxenable any user that doesn't have a mailbox in the OU Finance Users.
Get-User -OrganizationalUnit "domain.com/Departments/Finance Users" -RecipientTypeDetails User | Enable-Mailbox
Martina Miskovic
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2012 12:04am
If you want to enable mailbox for user in one OU, you can just follow Martina's suggestion to do that.
Get-User
http://technet.microsoft.com/en-us/library/aa996896.aspx
Enable-Mailbox
http://technet.microsoft.com/en-us/library/aa998251.aspx
Thanks,
Evan Liu
TechNet Subscriber Support in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com Evan Liu
TechNet Community Support
June 26th, 2012 3:58am
there is a sub OU with generic accounts under this OU... is there a way to use the above CMD line and EXCLUDE any SUB OU's?Twitter: @dguilloryjr LinkedIn: http://www.linkedin.com/in/dannyjr Facebook: http://www.facebook.com/#!/dguilloryjr
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2012 9:09am
You can add one filter for OU in that command to achieve the goal.
Here is an example for you, hope can give you some help:
OrganizationalUnit: Test
Sub OrganizationalUnit: cTest, sTest
Get-User -OrganizationalUnit "domain.com/Test" -RecipientTypeDetails User| where{$_.OrganizationalUnit -eq "domain.com/Test"}| enable-mailbox
This way it will enable-mailbox for users in OU Test, exclude the users in cTest and sTest.
Thanks,
Evan Liu
TechNet Subscriber Support in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com Evan Liu
TechNet Community Support
June 26th, 2012 9:59pm
ok tested this script and modified it a bit, whats the best way to get this ran every 12 hours?
Twitter: @dguilloryjr LinkedIn: http://www.linkedin.com/in/dannyjr Facebook: http://www.facebook.com/#!/dguilloryjr
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2012 3:55pm
ok tested this script and modified it a bit, whats the best way to get this ran every 12 hours?
Twitter: @dguilloryjr LinkedIn: http://www.linkedin.com/in/dannyjr Facebook: http://www.facebook.com/#!/dguilloryjr
Hi,
You could create a Scheduled Task that runs every 12 hours.
Mike Pfeiffer has written some very good information written about that.
Check Out: Creating Scheduled Tasks for Exchange 2010 PowerShell Scripts
Martina Miskovic
June 27th, 2012 4:13pm
If you need this ran every 12 hours, you can use Scheduled Task.
Thanks,
Evan Liu
TechNet Subscriber Support in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com Evan Liu
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2012 9:42pm