Ayehu Eyeshare: Executing Exchange 2010 Powershell Commands From Eyeshare
Ayehu Eyeshare: Executing Exchange 2010 Powershell Commands From Eyeshare
Ayehu Eyeshare: Executing Exchange 2010 Powershell Commands From Eyeshare
Ayehu eyeShare
December 2013
1
www.ayehu.com
December 2013
Contents
Ayehu eyeShare ............................................................................................................................... 1
Preparations .................................................................................................................................... 3
1. GET-MAILBOX ....................................................................................................................................... 6
2. NEW-MAILBOX ...................................................................................................................................... 6
3. GET-MAILBOXSTATISTICS ......................................................................................................................... 6
4. SET-MAILBOX ........................................................................................................................................ 6
5. GET-MAILBOXPERMISSION ...................................................................................................................... 6
6. GET-MAILBOXSERVER ............................................................................................................................. 6
7. GET-MAILBOXDATABASE ......................................................................................................................... 6
8. DISABLE-MAILBOX.................................................................................................................................. 6
9. ENABLE-MAILBOX .................................................................................................................................. 6
10. ADD-DISTRIBUTIONGROUPMEMBER ..................................................................................................... 6
Example ........................................................................................................................................... 7
Troubleshooting .............................................................................................................................. 8
2
www.ayehu.com
December 2013
Preparations
Domain Membership
The eyeShare server must be a member of the domain to be able to run remote shell exchange
commands. If the eyeShare server is not a domain member, add it to the domain.
eyeShare Executor
The eyeShare executor service must run with the permissions of a domain user that has
Exchange privileges.
3. Select the custom setup option, and check the Management Tools component only.
3
www.ayehu.com
December 2013
4
www.ayehu.com
December 2013
5
www.ayehu.com
December 2013
Make sure to replace each parameter inside <> with its correct value.
1. Get-Mailbox
get-Mailbox "<User Logon Name>" -erroraction 'silentlycontinue'| Format-List -Property Name,
Alias, Email*
2. New-Mailbox
$password = ConvertTo-SecureString "<Password>" -AsPlainText -Force; New-Mailbox -
UserPrincipalName <User Logon Name>@<Domain Name> -Alias <User Name> -Database
<Mailbox Database Name> -Name <User Name> -OrganizationalUnit <OU Name> -Password
$password -FirstName <User First Name> -LastName <User Last Name> -DisplayName <User
Display Name> -ResetPasswordOnNextLogon $true
3. Get-Mailboxstatistics
get-mailboxstatistics -Identity <UserLogonName> -erroraction 'silentlycontinue' | where
{$_.ObjectClass –eq “Mailbox”} | format-list StorageLimitStatus,TotalItemSize,Itemcount;"
4. Set-Mailbox
set-mailbox <Domain Name>\<User Logon Name> -ProhibitSendReceiveQuota 1GB
5. Get-MailboxPermission
Get-MailboxPermission -Identity <User Logon Name>@<Domain Name>
6. Get-MailboxServer
Get-MailboxServer –Identity <Server Name>
7. Get-MailboxDatabase
Get-MailboxDatabase -Server <Server Name>
8. Disable-Mailbox
Disable-Mailbox <User Logon Name>@<Domain Name> -Confirm:$False
9. Enable-Mailbox
Enable-Mailbox <User Logon Name>@<Domain Name>
10. Add-DistributionGroupMember
Add-DistributionGroupMember -Identity "<DL Name>" -Member "<User Logon
Name>@<Domain Name>"
6
www.ayehu.com
December 2013
Example
The following command and arguments return mailbox statistics of a user named “Nick”:
Result:
7
www.ayehu.com
December 2013
Troubleshooting
1. Error “The term 'c:\Program Files\Microsoft\Exchange
Server\V14\bin\RemoteExchange.ps1' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.” means that the exchange
management tools were not installed properly. Verify that the installation was
successful and that the path c:\Program Files\Microsoft\Exchange
Server\V14\bin\RemoteExchange.ps1 exists on the eyeShare server.
2. In case you get the error “The term '<command>' is not recognized as the name of a
cmdlet….” make sure that the Exchange Snap-ins are installed by running this command
from the command line:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Get-PSsnapin
In case there isn’t any Exchange Snap-ins installed, run this command:
add-PSSnapIn *ex*
8
www.ayehu.com