How to test Office 365 SMTP server using PowerShell

Office 365 supports SMTP relay for authenticated accounts using TLS encryption.

Testing SMTP access is traditionally done using Telnet, but that’s not always an option when using Office 365 due to the authentication requirement.

Fortunately it’s easy to use PowerShell to accomplish the same thing.


How to test SMTP server using PowerShell:

Capture and store the Office 365 credentials for the account you intend to use for SMTP auth:

$msolcred = get-credential | save the credential of from address

Use the stored credentials to send a test message from user@domain.com to user@example.com, over port 587 (Encrypted w/ SSL):

Send-MailMessage –From user@domain.com –To user@example.com –Subject “Test Email” –Body “Test SMTP Relay Service” -SmtpServer smtp.office365.com -Credential $msolcred -UseSsl -Port 587

Use Command Prompt to return the logged in user of a remote computer

If you need to determine the user account that is logged into a computer with a known IP address or computer name you may use the following command. This command is confirmed to work with Windows 7 but should also work the same on Windows 8 +.

You will need to make sure the Windows Firewall on the remote computer is configured to allow access inbound for “Remote Administration (RPC)” and/or “Remote Service Management (RPC)”

Open the Command Prompt and run:

“wmic.exe /node:(computer name or IP address) computersystem get username”

If you are returned an error of RPC server unavailable make sure the Firewall is open as described above.

Cannot display webpage after updating SSL Certificate

Check if the server certificate has the private key corresponding to it. Refer the below picture:

SSL Cert wo and wprivate key

If private key is missing, then you need to get a certificate containing the private key, which is essentially a .PFX file. There is a command that we could try to run in order to associate the private key with the certificate:

 C:\>certutil –repairstore my “‎1a 1f 94 8b 21 a2 99 36 77 a8 8e b2 3f 42 8c 7e 47 e3 d1 33”

 certutil repair

 Note: 1a 1f 94 8b 21 a2 99 36 77 a8 8e b2 3f 42 8c 7e 47 e3 d1 33 is the thumbprint of the certificate. Open the certificate and click on the details tab. Scroll down to find the thumbprint section. Select the thumbprint section and click on the text below. Do a “Ctrl+A” and then “Ctrl+C” to select and copy it. Below is a snapshot for your reference:

cert thumbprint 

If the association is successful, then you would see the following window:

successful cert repair

Error opening Word, Excel, PowerPoint files or email attachments in Office 2010

If you find that you are not able to open an Word 2010, Excel 2010, or PowerPoint 2010 file from the Internet or in some cases Outlook,  and you get an error message, performing the following steps will resolve the issue:

Office 2010 may report the file as being corrupt. The exact Errors may include:

Word: Word Experienced an error trying to open the file.:

Excel: The file is corrupted and cannot be opened.

PowerPoint: PowerPoint found a problem with content in file. PowerPoint can attempt to repair the presentation.

The following steps will set component security settings back to the defaults.

Open Control Panel

Open Administrative Tools

Open Component Services and expand the tree under Console Root to Computers > My Computer.

Right-click on My Computer and select Properties.

 repair_office1

Select the Default Properties tab and set the following values:

Default Authentication Level: Connect

Default Impersonation Level: Identify.

repair_office2

 

Preload Office 2013 on new computers for distribution to end users

This is a technique you can use to preload the Office 2013 installation media on a system, bypassing the need to download the installation files during activation.

You will require a qualified Microsoft Partner account in order to download the media from the following link:

http://www.microsoft.com/OEM/en/installation/downloads/Pages/office-single-image-v15-opk.aspx

  • Download the disk image appropriate for your language.
  • Extract the disk image using a utility like 7zip to a folder.
  • Copy the Office 2013 Single image source folder to local PC. (Folder contains installation data and batch files for prep)
  • Uninstall the already installed Office 2013 installer  from Programs and Features (if it already exists).
  • Run as administrator the script oemsetup.en-us inside the single image source folder, this preps the system to use the local source for Office 2013 instead of downloading.
  • Open the Microsoft Office app following script completion, and select Buy online.
  • Purchase the office software using a Microsoft account affiliated with the client or user.
  • Go through the purchase process until you have confirmed, and are presented with a product key. Make sure to document what key will be assigned to each user  if preparing multiple systems.
  • Copy the Product Key to your clipboard and go back to the Office installer and now select Activate.
  • Enter the Product Key you copied.
  • Select the Redeem Online button.
  • Sign in with the same Microsoft Account used to purchase the software.
  • Select the region and language.
  • Once the key has been associated with your account you will be taken to a web page that displays all keys tied to the account.
  • Minimize the browser window and go back to the Office installer.
  • Select Activate, on the enter product key screen select the option to “sign in with an active account instead”.
  • Sign in with the Microsoft account.
  • Once signed in, you should be presented with the ‘Choose your product window’.
  • The most recent purchase is a the bottom of this list,  select it and Continue.
  • Office Click-to-run will now complete the install using the local installation source instead of downloading the software. 

This is especially helpful when dealing with multiple systems at a site with poor download speed.

Connect Windows Explorer to an Office 365 Sharepoint Library

This post will outline the authentication process and configuration necessary to access an Office 365 SharePoint Library via a mapped drive in Windows Explorer.

This information was originally posted on Spiceworks.com at http://community.spiceworks.com/how_to/show/4133-office-365-sharepoint-map-network-drive

1.

Login to the Portal http://portal.microsoftonline.com

Sign in to the SharePoint Online site by using your Office 365 credentials. Make sure that you click to select the Keep me signed in check box. This is important because you need to be (and stay) authenticated via the web portal to access the SharePoint document library via a mapped drive.

 
2.

Click Start, Right-click Computer, and then click Map Network Drive

 

 
3.

Click the “Connect to a Web site that you can store your documents and pictures” link, and then click Next two times.

 

 
4.

Type the site URL, click Next, and then follow the instructions in the wizard.

Depending on your permissions level you may need to map to a document library level

 
5.

Remove the tick from “automatically detect settings” in your proxy settings page (found in the connections tab in Internet options).

This Really makes a big difference to folder traversal in explorer.

Troubleshooting

If you encounter issues with the mapped drive disconnecting follow these steps

Make sure that you are authenticated to Office 365. To do this, follow these steps: 
1. Sign in to the SharePoint Online site by using your Office 365 credentials, and make sure that you click to select the Keep me signed in check box. 
2. Open a document library in Explorer View. 
3. Try to access the mapped network drive.

If you are authenticated to Office 365 and the issue persists, make sure that the entries for SharePoint are added to the Trusted sites zone in Windows Internet Explorer. To do this, follow these steps: 
1. On the Tools menu In Internet Explorer, click Internet options. 
2. Click the Security tab, click the Trusted sites zone, and then click Sites. 
3. Verify that the following entries are listed in the Websites list:

https://*.outlook.com  
https://*.sharepoint.com
https://*.microsoftonline.com
https://*.lync.com   

 If these entries are not present, add them to the Trusted sites list of websites. 

Make sure that the entries for SharePoint are added to the Local Intranet Zone in Windows Internet Explorer. To do this, follow these steps: 
1. On the Tools menu In Internet Explorer, click Internet options. 
2. Click the Security tab.
3. Click the Local intranet zone, click Sites, and then click Advanced. 
4. Verify that the following entries are listed in the Websites list:

*.microsoftonline.com
*.sharepoint.com
*.outlook.com
*.lync.com

If the above entries are not present, add them to the Local intranet zone list of websites.

You should now be able to map a drive to a SharePoint Library

You may also use the Open with Explorer feature in SharePoint while you have a Library open by clicking the Library tab and selecting the Open with Explorer button located in the Connect and Export section:

Open with Explorer

Open with Explorer

Error Code 0x8007232b when activating Windows Server 2012

When you try to activate Windows Server 2012, you receive an error message that resembles the following:

Activation Error: Code 0x8007232b

DNS Name does not exist

Windows Server 2012 is trying to activate via KMS and it needs to be changed to your MAK key.

Change to Multiple Activation Key by going to Command Prompt and type:

slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx

Where xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx is the placeholder for your MAK key

Exchange Admin Center redirects to OWA

When installing Exchange 2013 in an environment with Exchange 2010, there is no link or application for Exchange Admin Center. Open a browser and type https://<Servername>/ecp/?ExchClientVer=15, this will give you direct access to the Exchange 2013 server, not on the Exchange 2010 server where the mailbox may reside.

Exchange Admin Center redirects to OWA

When installing Exchange 2013 in an environment with Exchange 2010, there is no link or application for Exchange Admin Center. Open a browser and type https://<Servername>/ecp/?ExchClientVer=15, this will give you direct access to the Exchange 2013 server, not on the Exchange 2010 server where the mailbox may reside.

Give user mailbox rights on Exchange Hosted – BPOS

To give a user full mailbox rights, to be able to send meeting requests as another user do the following:

1. Open Migration Command Shell

2. Type: Add-MSOnlineMailPermission –Identity UserName1@DomainName -TrustedUser UserName2@DomainName -GrantFullAccess $True

Where username1 is the mailbox that you want to give Username2 permission to

3. Enter the proper admin credentials and make sure that the command shell replies with Successfully granted user account username1.domain.com full access permission to mailbox username2@domain.com