Get Exchange 2010 mailbox size which includes the dumpster

The following commands are examples to get mailbox sizes for users mailboxes per Exchange database. This gives you both the actual mailbox size and the dumpster (Soft-Deleted) items, items which have been shift-deleted from any folders, or deleted from Outlook’s deleted items folder. To get a list of all users mailbox sizes per database in descending order, run the following command: Get-MailboxStatistics –database <DataBase> | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="TotalDeletedItemSize(MB)";expression={$_.totaldeleteditemsize.Value.ToMB()}},ItemCount I refer to this link, it talks about the TotalDeletedItemSize, this refers to the email sitting in the dumpster which is accessible from the users perspective using Outlook’s Recover…

Grant full mailbox access to an Exchange 2010 mailbox without Auto mapping the mailbox

Some examples below is granting full mailbox permissions to users without the auto mapping feature. Run the following command to grant full mailbox access to a single mailbox: Add-MailboxPermission –Identity <mailbox> –User <user> -AccessRights FullAccess -InheritanceType all -Automapping $false Or, to give a user access full access permissions to all mailboxes, run: Get-Mailbox | Add-MailboxPermission –User <user> -AccessRights FullAccess -InheritanceType all -Automapping $false  

Adding/Changing Windows Registry values using PowerShell

You can use PowerShell to change registry values in Windows. Below, I give a few different examples of how to use the cmdlet in varies scenarios. From the Microsoft knowledge base article http://support.microsoft.com/kb/154596 How to configure RPC dynamic port allocation to work with firewalls, below is the PowerShell way, using 4 separate PowerShell cmdlets in the same order: New-Item -Path HKLM:\Software\Microsoft\Rpc\Internet New-ItemProperty -Path HKLM:\Software\Microsoft\Rpc\Internet -Name Ports -PropertyType MultiString -Value 5984-5994 New-ItemProperty -Path HKLM:\Software\Microsoft\Rpc\Internet -Name PortsInternetAvailable -PropertyType String -Value Y New-ItemProperty -Path HKLM:\Software\Microsoft\Rpc\Internet -Name UseInternetPorts -PropertyType String -Value Y To disable IPv6, run the following cmdlet: New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters -Name DisabledComponents…

Export SCOM 2010 alerts to TXT/CSV file using PowerShell

You can use PowerShell to export alerts from SCOM 2010 to a CSV file with lots of information included. Please note, exported alerts are listed in Greenwich Mean Time (GMT) time zone. #Closed Critical Alerts get-scomalert -criteria ‘ResolutionState=255 AND Severity>=2’ | select MonitoringObjectDisplayName,Name,Severity,ResolutionState,TimeRaised,TimeResolved,Parameters | export-csv c:\ClosedCriticalAlerts.txt #New Critical Alerts get-scomalert -criteria ‘ResolutionState=0 AND Severity>=2’ | select MonitoringObjectDisplayName,Name,Severity,ResolutionState,TimeRaised,Parameters | export-csv c:\NewCriticalAlerts.txt #New Warning Alerts get-scomalert -criteria ‘ResolutionState=0 AND Severity>=2’ | select MonitoringObjectDisplayName,Name,Severity,ResolutionState,TimeRaised,Parameters | export-csv c:\NewWarningAlerts.txt Resolution State 0 = New 255 = Closed Severity Values for Alerts 0 = INFORMATIONAL 1 = WARNING 2 = CRITICAL

Export list of mail enabled users from Exchange 2010

Use PowerShell to export a list of mail enabled users from Exchange 2010: Get-User -ResultSize Unlimited | Where { $_.RecipientType -eq ‘UserMailbox’ } | ft firstname,lastname,samaccountname The following command will export the list to a CSV file: Get-User -ResultSize Unlimited | Where { $_.RecipientType -eq ‘UserMailbox’ } | select firstname,lastname,samaccountname | export-csv c:\MailEnabledUsers.txt

Use PowerShell to get members of an Active Directory (AD) group

To get a list of members of an AD security group using PowerShell, run the following from the Active Directory Module for Windows PowerShell. Get-ADGroupMember “<GroupName>” | Select Name, SamAccountName, objectClass Or, to get a list of user ojectClasses only, run: Get-ADGroupMember “<GroupName>” | where {$_.objectclass-eq “user”} | Select Name, SamAccountName Similar, to get a list of group ojectClasses only, run: Get-ADGroupMember “<GroupName>” | where {$_.objectclass-eq “group”} | Select Name, SamAccountName