Wednesday, November 20, 2013

how I configure a script to get into a Powershell CLI for editing Office365 properties

I was setting up a laptop to use a script to get into a Powershell CLI and wanted to document what I used to get in.

You'll need to download two items to enable PowerShell:

1) Microsoft Online Services Sign-in Assistant
2) Azure AD Module for Windows PowerShell

from here:

https://technet.microsoft.com/library/dn975125.aspx


You may need to install .net 3.5 from turn windows features on/off.

Then I created a folder on the root C called scripts.  In there, I created a file called office365.ps1 with these contents:
---
Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session
Connect-MsolService –Credential $O365Cred
---

Then I make edits by opening powershell.  Navigate to c:\scripts and run office365.ps1.  Of note, you might also need to enable remote execution (Set-ExecutionPolicy RemoteSigned) like this:









From there, I use the commands I described in this post:
http://t-solve.blogspot.com/2013/01/office365-shell-commands-for-reference.html



When I need to run a Powershell script, I open powershell, navigate to c:\scripts, and I run office365.ps1 like this:


Saturday, November 9, 2013

The name cannot be matched to a name in the address list for a valid user - Exchange 2010

In some cases, I hide old users in Exchange Management Console so they don't appear in the global address list.  I had done that with a certain user, and I kept trying and trying to no avail to configure his Outlook.  I kept getting "The name cannot be matched to a name in the address list for a valid user."  I could log in to webmail for the user, and I could log on to a laptop as the user with no trouble - but Outlook could not find the user during mailbox setup/configuration.

The error:















The solution (uncheck "hide from Exchange address lists")