Monday, April 30, 2012

Configure Protocol Logging in Exchange Server 2010

Protocol Logging logs all the SMTP conversation occurring between Exchange Server 2010 as part of message delivery. These conversations occur on Send or Receive Connectors that are configured on Exchange Server 2010 Hub Transport or the Edge Transport servers. These log files are helpful for administrators to troubleshoot mail flow problems. By default, protocol logging is disabled on all Send or Receive Connectors. Exchange Server 2010 uses Circular logging to restrict the log file size and file age to help control the hard disk space.
All the Receive Connectors configured on Hub Transport or Edge Transport share the same protocol log files and protocol log options. These log files and log options are different from the Send Connector configured on Hub Transport and the Edge Transport on the same servers.
Enable or disable protocol logging on connectors
You need to be assigned permissions before you can perform this procedure.
 How to configure Protocol Logging on Connectors from the EMC
  1. Perform one of the following steps:
    • On an Edge Transport server, in the EMC, select Edge Transport and then click the Receive Connectors tab in the work pane.
    • On a Hub Transport server, expand Server Configuration and then select Hub Transport. In the result pane, select the server that has the Receive connector you want to modify and then open its Properties.
  2. Click Properties under the name of the Receive Connector.
  3. Click the General tab and use the drop-down box next to Protocol logging level to enable or disable protocol logging. None disables protocol logging, and Verbose enables protocol logging.
  4. Click Ok to save the settings.
The above procedure is similar for Send connectors. To access Send connectors, you will have navigate to Organization Configuration > Hub Transport.

How to Use Shell to Enable or Disable Protocol Logging on Receive Connector
In the below example, we have enabled protocol logging level for the Receive connector "Connection from Techpeoples.net".
Set-ReceiveConnector -Connection from Techpeoples.net -ProtocolLoggingLevel Verbose
How to Use Shell to Enable or Disable Protocol Logging on Send Connector
In the below example, we have enabled protocol logging level for the Send connector "Connection from Techpeoples.net".
Set-SendConnector -Connection from Techpeoples.net -ProtocolLoggingLevel Verbose

How to Configure the Location of the Protocol Log Files
The default location of Receive connector log files are at C:\Program Files\Microsoft\Exchange├é Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive, and the Send connector protocol log files location is C:\Program Files\Microsoft\Exchange├é Server\V14\TransportRoles\Logs\ProtocolLog\SmtpSend.

How to change the location of Receive Connector log files:
Set-TransportServer PC01 -ReceiveProtocolLogPath "C:\Receive SMTP Logs"

How to change the location of Send Connector log files:
Set-TransportServer PC01 -SendProtocolLogPath "C:\Send SMTP Logs"

Log file location can also be changed from the Exchange Console.

How to Configure the Maximum Size of each Protocol Log File
The default size of each protocol log file is 10MB. All Receive connectors on the server share the same protocol log files and all Send connectors on the same server share the same protocol log files. When this limit is reached, a new protocol log file is created until the protocol log directory reaches its specified maximum size or a protocol log file reaches its specified maximum age. Circular logging deletes the oldest log file after the maximum size or maximum age limit is reached.

We cannot use the Exchange Console to change the maximum size of each protocol log file:
Below we have used to syntax to change the maximum file size of Send and Receive connector from the Shell:-

Set-TransportServer PC01 -ReceiveProtocolLogMaxFileSize 30MB
Set-TransportServer PC01 -SendProtocolLogMaxFileSize 30MB

How to Configure the Maximum Size of each Protocol Log Directory
The default size of each protocol log directory is 250MB. All Receive connectors on the server share the same protocol log files and all Send connectors on the same server share the same protocol log files. When this limit is reached, a new protocol log file is created until the protocol log directory reaches its specified maximum size or a protocol log file reaches its specified maximum age. Circular logging deletes the oldest log file after the maximum size or maximum age limit is reached.

We cannot use the Exchange Console to change the maximum size of each protocol log file:
Below we have used to syntax to change the maximum directory size of Send and Receive connector from the Shell:-


Set-TransportServer PC01 -ReceiveProtocolLogMaxDirectorySize 400MB
Set-TransportServer PC01 -SendProtocolLogMaxDirectorySize 400MB

How to Configure the Maximum Age of Protocol Log Files
The default age of each protocol log file is 30 days. All Receive connectors on the server share the same protocol log files and all Send connectors on the same server share the same protocol log files. When this limit is reached, a new protocol log file is created until the protocol log directory reaches its specified maximum size or a protocol log file reaches its specified maximum age. Circular logging deletes the oldest log file after the maximum size or maximum age limit is reached.

We cannot use the Exchange Console to change the maximum size of each protocol log file:
Below we have used to syntax to change the maximum directory size of Send and Receive connector from the Shell:-


Below we are configuring the age limit on Send and Receive connector to 60 days.
Set-TransportServer PC01 -ReceiveProtocolLogMaxAge 60.00:00:00
Set-TransportServer PC01 -SendProtocolLogMaxAge 60.00:00:00

Thursday, April 26, 2012

Fresh Win2008 R2 Domain Controller & Exchange 2010 Servers Installation

-Windows 2008 R2 x64 - install
-Computer Name (ny-dc-2k8)
-FQDN Name (mmx.com)
-NetBIOS Name (mmx)
-reg add hklm\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /t REG_DWORD /d 255

-net user administrator /active:yes Pa55w0rd --> optional
-net user administrator /active:yes /passwordreq:yes --> optional

-Change Administrator's Name (Right Click -> Rename -> Change Login name -> select domain name -> change password)
-Logout Administrator -> Login with new administrator's name (c:\users\administrator) profile folder name won't be change.
-use DSADD.bat file or manually add user / group at command prompt.
-Start -> Run -> regsvr32 schmmgmt.dll (register Schema Master)
-Active Directory Users and Computers -> Raise Domain Functional Level -> 2003 (atleast)
-Active Directory Domain and Trust -> Raise Forest Functional Level -> 2003 (atleast)
-Copy or Insert Exchange 2010 installer to "ny-dc-2k8"
-Command Prompt -> c:\exchange\setup setup /PrepareLegacyExchangePermissions:ny-dc-2k8.mmx.com or setup /pl:ny-dc-2k8.mmx.com (if u have previous exchange servers)
-Command Prompt -> c:\exchange\setup setup /PrepareSchema or setup /ps (to run this command you should be in "Schema Admins" group)
-Command Prompt -> c:\exchange\setup  /PrepareAD /OrganizationName:mmx (to run this command you should be in "Exterprise Amdins" group)
-Command Prompt -> c:\exchange\setup  /PrepareAllDomains

-------------------------------------------------All the above commands run on  ny-dc-2k8---------------------------------------------------------------------------------------
For Exchange Server 2010 installation

-Windows 2008 R2 x64 - install
-Computer Name (ny-cas-2k8)
-Join to domain , become member server
-Login with administrator account
-2007 Office System Converter: Microsoft Filter Pack (FilterPackx64.exe - download and install it - 4.1MB)

Type in power shell

-Import-Module ServerManager 

hxxp://technet.microsoft.com/en-us/library/bb691354.aspx

(For a server that will have the typical installation of Client Access, Hub Transport, and the Mailbox role)
-Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy -Restart

For Cas / Hub Transport Servers

Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,
Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,
Web-Net-Ext,Web-Lgcy-Mgmt-Console,
WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,
Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,
Web-Asp-Net,Web-Client-Auth,Web-Dir-Browsing,
Web-Http-Errors,Web-Http-Logging,Web-Http-Redirect,
Web-Http-Tracing,Web-ISAPI-Filter,Web-Request-Monitor,
Web-Static-Content,Web-WMI,RPC-Over-HTTP-Proxy -Restart
 
For Hub Transport OR Mailbox Server Only
 
Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,
Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,
Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server -Restart 



-Set-Service NetTcpPortSharing -StartupType Automatic

(Setup /m:install,Uninstall,Upgrade,RecoverServer) <- examples

[/InstallWindowsComponents] [/OrganizationName:]
[/TargetDir:] [/SourceDir:][/UpdatesDir:]
[/DomainController:] [/AnswerFile:]
[/DoNotStartTransport] [/EnableLegacyOutlook] [/LegacyRoutingServer]
[/EnableErrorReporting] [/NoSelfSignedCertificates] [/AdamLdapPort:]
[/AdamSslPort:] [/LanguagePack:] [/AddUmLanguagePack:]
[/RemoveUmLanguagePack:] [/NewProvisionedServer:] [/RemoveProvisionedServer:]
[/ExternalCASServerDomain:] [/MdbName:] [/DbFilePath:] [/LogFolderPath:] [/Upgrade] [/Hosting]

ClientAccess (or CA, or C)
EdgeTransport (or ET, or E)
HubTransport (or HT, or H)
Mailbox (or MB, or M)
UnifiedMessaging (or UM, or U)
ManagementTools (or MT, or T)

-setup    /m:install /r:CA,HT (Only CAS and Hub Transport Servers) <- run at command prompt

-setup   /m:install /r:MB

Tuesday, April 24, 2012

Upload picture in Outlook 2010 using the Exchange Management Shell (Exchange 2010)

The thumbnailPhoto attribute can accomodate photos of up to 100K in size, but the Import-RecipientDataProperty cmdlet won't allow you to import a photo that's larger than 10K

The original picture used in this example was 9K, and you can compress it further to a much smaller size - let's say approximately 2K-2.5K, without any noticeable degradation when displayed at the smaller sizes. If you store user certificates in Active Directory, the 10K or smaller size thumbnail pictures are comparable in size. Storing thumbnails for 10,000 users would take close to 100 Mb, and it's data that doesn't change frequently.

Set-Mailbox "Rachel Peach" -RemovePicture

Export-RecipientDataProperty -Identity "Rachel Peach" -Picture | ForEach {$_.FileData | Add-Content C:\exported\RachelPeach.jpg -Encoding Byte}
 
Note: The recommended thumbnail photo size in pixels is 96x96 pixels.

If you're on Exchange 2010 SP1, skip this step. The attribute is modified by 'setup / SchemaPrep'
  1. If you haven't registered the Schema MMC snap-in on the server you want to make this change on, go ahead and do so using the following command:
    Regsvr32 schmmgmt.dll
  2. Fire up a MMC console (Start -> Run -> MMC) and add the Schema snap-in
  3. In the Active Directory Schema snap-in, expand the Attributes node, and then locate the thumbnailPhoto attribute. (The Schema snap-in lists attributes by its ldapDisplayName).
  4. In the Properties page, select Replicate this attribute to the Global Catalog, and click OK. 
  5. Now you can start uploading pictures to Active Directory using the Import-RecipientDataProperty cmdlet, as shown in this example:

    Import-RecipientDataProperty -Identity "Zaw Htet" -Picture -FileData ([Byte[]]$(Get-Content -Path "C:\pictures\zawhtet.jpg" -Encoding Byte -ReadCount 0))

    Where are the pictures physically stored? In AD, in the db somewhere or in the user's mailbox on the Exchange server?
    - Information is stored in active directory database

     Remove Pictures from Outlook 2010
    Key: HKCU\Software\Microsoft\Office\12.0\Outlook\Options\Mail DWORD: ShowContactPicture Values:1 (or missing DWORD) = show contact picture if available 0 = do not show contact picture

    All you need to do is:
    File > Options > Contacts
    And uncheck the box next to "Show user photographs when available"
    Ok and then restart Outlook.

How do I install Active Directory management tools on Windows 7?

The Remote Server Administration Tools (RSAT) for Windows 7 can be downloaded from Microsoft's web site:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=...
After downloading and installing the tool on your Windows 7 computer, use the Turn Windows features on or off function to enable AD management tools.
  1. From the Control Panel, click on Programs.
  2. Under Programs and Features, select Turn Windows features on or off.
  3. Under Remote Server Administration Tools > Role Administration Tools, select AD DS and AD LDS Tools.

Monday, April 23, 2012

WS-Management Service Error on Exchange 2010

Sometimes you will face the error above, when you access EMC for exchange 2010.

You can increase the concurrent shell numbers or you can type "iisreset  /noforce" or if its not work "iisreset  /restart".

Manage Exchange 2010 from Windows 7 PowerShell

- Install PowerShell 2.0 (if Windows XP SP2 / SP3)
- Open PowerShell then type "notepad $profile" without quotes. - Notepad will come up named with "Microsoft.PowerShell_Profile.ps1" - Copy and paste following line

$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://your-cas-server.mmx.com/PowerShell/ -Authentication Kerberos Import-PSSession $s

- Save and exit the notepad.
- Open PowerShell - Now you're ready to use PS.

If you launch the command Get-ExecutionPolicy you will see that the default policy is set to Restricted, basically creating your problem.

Now we can change that value to 5 different settings:
1. Restricted: no scripts will be executed
2. Unrestricted: all scripts will be executed
3. RemoteSigned: all scripts you created yourself will be run, all scripts downloaded from the internet will need to be signed by a trusted publisher
4. AllSigned: all scripts, including your own, will need to be signed by a trusted publisher
5. Default: = Restricted (unless you change the default value to something else) OK, so now that we know that we can change the policy by simply typing Set-ExecutionPolicy RemoteSigned.

Friday, April 6, 2012

P2V – Step by Step Removing Physical Hardware

It’s been a while since I had to P2V a Windows server but recently I found myself on a project doing P2Vs of business critical servers, again.
FYI: The new version of VMware VM Converter works great for converting a physical Windows and Lunux server into a virtual server.
Once the conversion is completed, the new VM is online, VMtools are installed and video acceleration is set, here’s a couple more steps I learned about at a VMUG meeting that I recommend doing to finish the P2V job.
First – Remove Old Physical Hardware from the New Windows VM (picture shows “grayed” disk drives)
Step 1 -  Log into the VM
Step 2 -  Open a command prompt
-    Start > Run
-    CMD
-    Enter
Step 3 – At the prompt type: set devmgr_show_nonpresent_devices=1
-    Enter
-    Type: start devmgmt.msc
-    Enter
Step 4 – Wait for the Device Manager to open, then click on View > Show Hidden Devices
- Expand each category and search for “grayed” hardware
- Right click and click uninstall when “grayed” hardware is located
- Don’t worry about the System Devices category
- When all the hardware devices are gone, close the Device Manager and reboot
Second – Uninstall Old Hardware Specific Software
Step 1 – Log into the VM
Step 2- Start > Control Panel > Add/Remove Programs
Step 3 – Carefully find and uninstall programs from IBM/Dell/HP/other that are used for drive arrays, networking, ILO or any other similar application that is specific to the physical hardware.
Note: These items are not required now that the server hardware has been virtualized.
Done – When all the applications have been uninstalled, close the Control Panel and reboot
Q: Why do this?
A: The reason I do these steps is because over the years I’ve had to troubleshoot VMs that I found were P2V’d by someone else and not cleaned up. This normally causes poor performance and issues with ghost hardware that conflict with the virtual hardware devices, more specific – network adapters.
There – now all you need to do is make sure all your best practices are applied to the VM and it’s ready for production.

SAP Local Client Copy (SCCL)

Step by Step Procedure to create a copy of a client locally in the same SAP server.
1. Logon to SAP server
2. Use Transaction Code SCC4
3. Go to change mode
4. Create a new client, assign client number & description as per request
5. Logoff from current client.
6. Login to newly created client using the following credentials :
i. Client Number : Newly created one
ii. User Id : SAP*
iii. Password : PASS
7. Use Transaction Code SCCL for local client copy
8. Give reference client for copy and profile as per the request
9. Use SCC3 Transaction code to monitor progress of Client Copy.

Golden rules for CLIENT Copies
1. Master data can not be copied without copying transactional data and transactional data can not be copied without copying master data.
2. Application data (transactional and master) should not be copied without copying configuration data.
3. Client copy requires a valid client as the destination client. Make sure that the client exists in T000 table and you can logon to that client.
4. The transport system and the transport management system of 4.0 are the only proper tool to be use to keep multiple systems in sync by transporting development and customizing changes to another instance.
5. When you copy a client from one system to another, client-independent tables should only be copied if they are not yet modified in the target system.
6. We recommend the users to read all the OSS notes regarding client copy that applies to their SAP release. It is always better to schedule the client copy job in the background for the night run when normal work is not taking place.
7. Always check the database space before performing a client copy.
8. To avoid data inconsistencies all the users working in the source and target clients should logoff from the system.
9. RSCLICHK program should be run in the target system remotely before doing a client export. This program will give information about the missing definitions from the data dictionary in the target. After executing this program and getting successful results you can ensure that the client copy will have no problems. In case some tables are different; you can use SE11 to compare and adjust the table structure in both the system before the client copy. A remote test client copy also can be executed to know the differences between source client and target client.
10. If you are not in release 2.2 then do not use R3trans to copy a client.

SCC1 Client Copy - Special Selections
SCC2 Client transport
SCC3 Client Copy Log
SCC4 Client administration
SCC5 Client Delete
SCC6 Client Import
SCC7 Client Import – Post Processing
SCC8 Client Export
SCC9 Remote Client Copy
SCCL Local Client Copy


 -------------------------------------------------------------------------------


SAP Local Client Copy Step by Step



Process
T-Code : SCC4 (Display View “Client” Overview)
1.Choose “Change”
2.Telephone(Optional)




Process
2.Choose “New Entries”


Process
3.Input Client Number and Description
4.Input City
5.Input Logicla system
6.Input currency
7.Choose Client role(Customizing)
8.Select Automatic recording of changes
9.Select “Cross-Client Object Changes”
10.SAVE


Process
15.Log-in to New client(200)


Process
11.Log-in to New client(200)
ID : sap*
password : pass


Process
T-code : SCCL
1.Select “Profile”
2.Input Source client
Input Source client User Masters

Process
T-code : SCCL
4.Choose Parallel Processing
5.Choose Logon Server Group
6.Save


7.Choose Schedule as Background Job


8.Choose immediately or Schedule Job
9.Choose No Printer Dialog


10.Click “Wizard”

11.Click “Continue”
12.Click “Continue”
13.Click “Continue”
14.Click “Complete”
15.Logon to Source system
16.Confirm
17.Confirm
18.Check Copy Process with SCC3
 
 ---------------------------------------------------------------------------------------------------------


Deleting client:
  1. Deleting a client is very dangerous task. We should be very careful in deleting a client.
  2. Login to the client which you want to delete.
  3. Type the transaction code scc5
  4. Tick the delete entry from T000 and click delete in Background button (F8).
  5. Click the background server and select the check box Immediately and click Schedule job.
  6. Click continue in verification screen.
  7. Hit Enter in the information message screen.
  8. This background job can be viewed by using t-code scc3
  9. Do not delete any sap standard clients.
 



Quote of the Day