Sign up for Office 365
Learn more about Office 365
Thanks for the feedback.
There is no GUI functionality for this in O365, but there are couple of other ways that I can think of.
1. The easy way - use Outlook to export contacts to a .csv: office.microsoft.com/.../export-contacts-HA101870639.aspx
2. Use the Get-MailContact cmdlet in Remote Exchange PowerShell. Here's a quick example:
Get-MailContact | select Alias,ExternalEmailAddress | export-csv contacts.csv
I tried to use the Get-MailContact cmdlet, but it didn't work. Don't you need to have an Active Directory account for this to work?
I only have the accounts in my domain online, we don't use Outlook on the computers and we don't have Active Directory.
Is there any way to use PowerShell cmdlets to get alla contacts from an Office 365 account?
You do not need to have an AD account. Make sure you are connecting powershell to the 365 servers.
Open powershell and type this:
Use your 365 admin account when it prompts for credentials.
When I type:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri ps.outlook.com/powershell -Credential $AdminCredentials -Authentication Basic -AllowRedirection
and then type in the admin account info when it prompts for credentials I get the message:
Relative Uris are not supported in the creation of remote Sessions.
+ CategoryInfo : InvalidArgument: (ps.outlook.com/powershell:Uri) , NotSupportedException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
Should I change anything in the command you gave me? I typed in the command "Import-Module MSOnline" before.
I hope you can help me with this problem.
First of all you need to make sure you have the right module installed on the server/machine you are using. And that you have SSO installed.... Follow these directions first:
To begin using the Office 365 cmdlets, you first need to install them. The requirements for installing the Office 365 cmdlets are as follows:
To install the cmdlets, perform the following steps:
Download one of the following from the Microsoft Download Center:
To install the cmdlets, double-click the AdministrationConfig.msi file.
The installer adds the program to your Start menu and a shortcut to your desktop.
After doing the above, create a .ps1 file with exactly this inside it:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $AdminCredentials -Authentication Basic -AllowRedirection
Run that .ps1 with powershell, and you should have all your commands available to you.
**After looking at my first post I realized the forum auto edited the HTTPS:// portion of the -connectUri string. You need to have it exaclty as I have just typed. above.