Saturday, March 21, 2015

How to Enable Personalize option on “Server 2008”

How to Enable Personalize option on “Server 2008”

 
Run this command through Administrative privilege:
 
"%Systemroot%\system32\rundll32.exe" shell32.dll,Control_RunDLL desk.cpl,,0

 
 
Click on OK


Thanks
 

Monday, March 16, 2015

Exchange Server Port Need to Open from Firewall

This Port need to open from your network for Exchange Server....

Protocol
Port
Description
SMTP
TCP: 25
The SMTP service uses TCP port 25.
DNS
TCP/UDP: 53
DNS listens on port 53. Domain controllers use this port.
LSA
TCP: 691
The Microsoft Exchange Routing Engine service (RESvc) listens for routing link state information on this port.
LDAP
TCP/UPD: 389
Lightweight directory access protocol (LDAP) used by Microsoft Active Directory® directory service, Active Directory Connector, and the Microsoft Exchange Server 5.5 directory use this port.
LDAP/SSL
TCP/UDP: 636
LDAP over Secure Sockets Layer (SSL) uses this port.
LDAP
TCP/UDP: 379
The Site Replication Service (SRS) uses this port.
LDAP
TCP/UDP: 390
This is the recommended alternate port to configure the Exchange Server 5.5 LDAP protocol when Exchange Server 5.5 is running on an Active Directory domain controller.
LDAP
TCP: 3268
Global catalog. The Windows 2000 and Windows Server 2003 Active Directory global catalog (a domain controller "role") listens on TCP port 3268.
LDAP/SSLPort
TCP: 3269
Global catalog over SSL. Applications that connect to TCP port 3269 of a global catalog server can transmit and receive SSL encrypted data.
IMAP4
TCP: 143
Internet Message Access Protocol (IMAP) uses this port.
IMAP4/SSL
TCP: 993
IMAP4 over SSL uses this port.
POP3
TCP: 110
Post Office Protocol version 3 (POP3) uses this port.
POP3/SSL
TCP: 995
POP3 over SSL uses this port.
NNTP
TCP: 119
Network News Transfer Protocol (NNTP) uses this port.
NNTP/SSL
TCP: 563
NNTP over SSL uses this port.
HTTP
TCP: 80
HTTP uses this port.
HTTP/SSL
TCP: 443
HTTP over SSL uses this port.

Friday, February 20, 2015

How to Create Multiple AD Group in PowerShell Script

#;
  

Date: 20-Feb-2015 ; 11:37AM
Author: Ashish Kumar Jha
Email: aashujha@gmail.com
blog:
http://ajhaexchange.blogspot.in/

#

#Notes

# make sure you have RSAT Tool Installed
# Make Sure you imported Active Directory Module before running this command


# Global Variables

# OU Path of the Group in which we want to create groups
$path = "OU=testing,DC=techmesupport,DC=in"


# Domain Admin Credentails
$cre = get-Credential
 

#Main Server
$srvr = "DC-LAB"


# username is domain users "SAM Account " name , use Get-AdUser to find our SAM name of the user.
$usr = "aashujha"


#Dfine Group which need to be created
$grpname = "Test1","Test2"

# Lets use ForEach patters to create the group


foreach ($group in $grpname) {
$name = $group
 

# Just a console message
write-Host -ForegroundColor Magenta "Grouname is $name."


# Using AD Module
New-ADGroup -Path $path -Name $name -GroupCategory Security -GroupScope Global -Server $srvr -Credential $cre


# Just a console message
Write-Host -ForegroundColor Yellow "Group $name Created, let me add users in to this group."


# Using AD Module
Add-ADGroupMember $name $usr -Server $srvr
 

# Just a console message
Write-Host -ForegroundColor Green "Member are added to the group $name ."


####Everything Should be done by now ###


}

### End of the Script#### | A S H I S H | J H A | 


Thursday, February 19, 2015

Mail Export and Item Removed

  • Get-MailboxStatistics -Database "MailArchive" | ft DisplayName, TotalItemSize, ItemCount
  • Get-MailboxStatistics ashish
  • Get-MailboxDatabase -Status | ft Name,DatabaseSize,AvailableNewMailboxSpace
  • Get-MailboxExportRequest

  • New-MailboxExportRequest -Mailbox ebldocument -FilePath \\eraex1\pst\ebldocumetsArchive.pst -IsArchive
  • Get-MailboxExportRequest | where {$_.status -eq "Completed"}
  • Get-MailboxExportRequest | where {$_.status -eq "Completed"} | Remove-MailboxExportRequest
 
 

All Archive mail Box Size

  • Get-Mailbox -archive | Get-MailboxStatistics -archive |fl DisplayName, Total*
 

Get Individual Archive Mail Box Size

  • Get-Mailbox -Identity bot.d -Archive |Get-MailboxStatistics -Archive |fl Displayname, Total*


Proper way of deleting/purging disconnected mailboxes on Exchange 2010 after mailbox move

 
When mailboxes are moved from Exchange 2010 SP1 database to any other database, Exchange doesn’t fully delete the mailbox from the source database immediately upon completion of the move. Instead, the mailbox in the source mailbox database is switched to a soft-deleted state. Mailboxes data can be accessed during a mailbox restore operation using the MailboxRestoreRequest cmdlet set. The soft-deleted mailboxes are retained in the source database until either the deleted mailbox retention period expires or you use the Remove-StoreMailbox cmdlet to purge the mailbox. I’ve documented the removal procedure below.
 
1. Update the databases to show all disconnected mailboxes
 
Get-MailboxDatabase | Clean-MailboxDatabase
 
2. List all disconnected mailboxes and display Disconnect Reason if it’s Soft Deleted
 
Get-MailboxDatabase | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”} | Select DisplayName,Database,ItemCount,TotalItemSize
 
List all disconnected mailboxes in a database and display DisconnectReason if its SoftDeleted or Disabled
 
Get-MailboxStatistics -Database “mydatabase” | Where-Object {$_.DisconnectDate -Notlike $NULL} | Format-Table DisplayName, DisconnectDate, MailboxGuid, DisconnectReason –Wrap
EX:
Get-MailboxStatistics -Database DB1 | Where-Object {$_.DisconnectDate -Notlike $NULL} | Format-Table DisplayName, DisconnectDate, MailboxGuid, DisconnectReason –Wrap
 
3. Remove all SoftDeleted disconnected mailboxes from a Database
 
$Mailboxes = Get-MailboxStatistics -Database DB1 | where {$_.DisconnectReason -eq “SoftDeleted”}
 
$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}
 
#Remove all Disabled disconnected mailboxes from a Database
 
$Mailboxes = Get-MailboxStatistics –Database “DB1 | Where-Object {$_.DisconnectReason –eq “Disabled”}
 
$Mailboxes | ForEach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled}
 
 
When mail box move from one database to another mail box server and different database, mail box showing disconnected state and mail box is not able to connect.
Check and run below mention command twice or thrice clean state twice or
[PS] C:\Windows\system32>Get-MailboxDatabase | Clean-MailboxDatabase
[PS] C:\Windows\system32>Get-MailboxDatabase | Clean-MailboxDatabase
[PS] C:\Windows\system32>Get-MailboxDatabase | Clean-MailboxDatabase
[PS] C:\Windows\system32>Get-Mailbox "hradmin" | Disable-Mailbox
Confirmed
Are you sure you want to perform this action?
Disabling mailbox "eragroup.in/ERAGROUP AD STRUCTURE NEW/SECURITY GROUP/BACKUP/New Backup/Ext Int Hr and Admin" will remove the Exchange properties from the
Active Directory user object and mark the mailbox in the database for removal. If the mailbox has an archive or remote archive, the archive will also be marked
 for removal. In the case of remote archives, this action is permanent. You can't reconnect this user to the remote archive again.
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): a
 
And try to connect from exchange management console. The disconnected mail box will connected from disabled mail box.
Note:
By default, Exchange 2010 keeps disconnected mailbox’s in the DB for 14 days.  But say you want to remove this mailbox now and return it’s white space to use in the DB.  You need to remove the mailbox from the shell. 
  

Saturday, February 14, 2015

Delet All Mail from User Mail Box


[PS] C:\Windows\system32>Get-mailbox -Identity "ashish"| add-mailboxpermission -user administrator -AccessRights FullAccess

[PS] C:\Windows\system32>Get-Mailbox -Identity ashish |Search-Mailbox -DeleteContent -Force

RunspaceId                  : b5559ccf-f8d6-4ef5-8a16-49f21b3de911
Identity                         : ashish.in/Disabled Account/Ashish [Corporate]
TargetMailbox             :
TargetPSTFile             :
Success                        : True
TargetFolder               :
ResultItemsCount       : 238
ResultItemsSize          : 79.7 MB (83,567,493 bytes)

Friday, February 13, 2015

Removing an auto-mapped mailbox in Exchange 2010


Removing an auto-mapped mailbox in Exchange 2010

As you’ve noticed, removing a mailbox that has been added via the auto-mapping feature is not possible via the traditional way. In fact, as an end-user, there is nothing you can do to remove it in Outlook.

However, you can ask your Exchange administrator to remove the auto-mapping attribute for your account from the additional mailbox you’ve been granted “Full Access” to.

Your administrator can then run the following PowerShell command in the Exchange Management Shell:

Add-MailboxPermission -Identity -User -AccessRights FullAccess -InheritanceType All -Automapping $false