Pages

June 25, 2013

Access Exchange Server remotely via Powershell on Domain Joined and Non-Joined System

Accessing Exchange Server 2010 with Remote Powershell on Domain Joined System

To enable remote Shell for a user
Set-User Username -RemotePowerShellEnabled $True

 --Windows PowerShell scripts (if any) will be allowed to run on your compute--
 Set-ExecutionPolicy RemoteSigned

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:///PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session

Disconnects from the Exchange 2010 server
Remove-PSSession $Session

Accessing Exchange Server 2010 with Remote Powershell on Non-Domain Joined System

--Windows PowerShell scripts (if any) will be allowed to run on your compute--

Set-ExecutionPolicy RemoteSigned

--To get around with sethis and basically ignore all certificate issues all together, you can create a PSSessionOption object that disables these certificate validation checks--

$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck

--- Enable Basic Authentication on Powershell Virtual Directory ----

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:///powershell -Authentication basic -Credential (Get-Credential) -SessionOption $so

Import-PSSession $session

Disconnects from the Exchange 2010 server
Remove-PSSession $Session

May 11, 2012

Few Exchange Server 2010 Powershell Commands

Check Calander permission

Get-MailboxFolderPermission -Identity username@domain.com:\calendar

Check Public folder client permission

Get-PublicFolder -Server servername -Identity "\finance\employeesalary" | Get-PublicFolderClientPermission | fl user, accessrights

Check Public folder client permission

Add-PublicFolderClientPermission servername -Identity "\finance\employeesalary"  -User "UserDisplayName" -AccessRights Reviewer

How to see DiskSpace :-

get-wmiobject -computername servername -class win32_logicaldisk -filter "drivetype=3" | ft DeviceID, freespace, size

Check Mailbox Count
get-mailbox -database databasename | measure-object | select count

Group Members
Get-DistributionGroup "groupname" | Get-DistributionGroupMember

Duplicate SMTP Address
proxyaddresses=smtp:username@domain.com

Mailbox Size with Users Email ID

Get-Mailbox –Database databasename Select-Object name,primarysmtpaddress,DisplayName,Database,@{n="Size(MB)";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize.value.toMB()}},@{n="Items"; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.itemcount}}

Check Backup Status
Get-MailboxDatabase -Server servername -Status | ft Identity, lastfullbackup, lastincrementalbackup

Check Full mailbox Permission on a Mailbox

get-mailboxpermission -identity mailboxname | where-object {$_.accessrights -eq "fullaccess"} | ft user

See all objects of a forest 


Check Mail Queue greater than 5 on all HUB Servers
Get-ExchangeServer | where {$_.isHubTransportServer -eq $true} | get-queue | where {$_.MessageCount -gt 5} |measure-object MessageCount –max

Check Current State of VSS

VSSADMIN LIST WRITERS

Check Status of Cluster Nodes

CLUSTER NODE /STATUS

Check Quorum Drive of a DAG

Get-DatabaseAvailabilityGroup dagname | fl *witness*

How to check Non IPM Subtree of Exchange 2003 (System Public Folder)

October 22, 2011

What is SPF ?

Email Security :-
Now a day's Email Security is a big concern, without Mail administrator we can't judge any mail that this came from correct domain owner's SMTP Server or not
On June 2003 new standard was published to get rid of this problem "SPF"
What is SPF?
Sender Policy Framework (SPF) is an email validation system designed to prevent email spam by detecting email spoofing, a common vulnerability, by verifying sender IP addresses. SPF allows administrators to specify which hosts are allowed to send mail from a given domain by creating a specific SPF record (or TXT record) in the Domain Name System (DNS). Mail exchangers use the DNS to check that mail from a given domain is being sent by a host sanctioned by that domain's administrators.
Sender Policy Framework is defined in IETF publication RFC 4408.
For more details you can refer to :-
Note :- if I'm breaking any compliance without my knowledge, please update on my blog so I'll be notified & remove those content.

Understanding Disclaimers in Exchange 2010

What happens when we run new mailbox creation wizard in Exchange 2003


This adds below attributes :-
HomeMDB : home location of mailbox in database
Homemta : native mta
Legacyexchangedn : used for compatibility with exchange 5.5
Mail : primary email address
Mailnickname : maillbox alias
Msexchhomeserver : the server which your mailbox is located
Msexchmailboxguid : guid for primary sam account of mailbox
Msexchmailboxsecuritydescriptor : defines mailbox rights
Proxyaddresses - additional address

Also this set permission to Self only, that’s why mailbox is created only after sending mail to that user Or when user log in.

September 24, 2011

How to check Last Domain Logon of a User

Open your Domain Controller.

Start > Run > Adsiedit.msc

go to Domain Partition > find that particular user then Right Click

and check the attribute lastlogon, here you will see a Value like this "128271382742968750"

now open command prompt and run below command to change this to date format

w32tm.exe /ntte 128271382742968750

the Result will be like below :-

148462 05:57:54.2968750 - 6/24/2007 11:27:54 AM (local time)

Note : if you have multiple ADC then you need to check this on all ADC for latest Logon time.