• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1461
  • Last Modified:

List of Users in Office 365

In office 365, How we can get a full list of users and their full information, specially their emails since most of them have more than one email?
0
ACS2012
Asked:
ACS2012
  • 3
  • 3
  • 2
3 Solutions
 
Stelian StanCommented:
Run the following command:

Get-MsolUser | select DisplayName,UserPrincipalName |export-csv –path C:\users.csv
0
 
ACS2012Author Commented:
then how I can connect using powershell??
0
 
Vasil Michev (MVP)Commented:
Easiest way is to download and run the Helper scripts: http://www.microsoft.com/en-us/download/details.aspx?id=29568. Extract it and run the GetMsolUserReport.ps1 script, you just need to provide your credentials.

Make sure you have the Office 365 module installed first: http://onlinehelp.microsoft.com/office365-enterprises/hh124998.aspx#BKMK_install
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ACS2012Author Commented:
I tried it, I got the following error:

PS C:\Office 365 Deployment Tools\Helper Scripts> GetMsolUserReport.ps1
GetMsolUserReport.ps1 : The term 'GetMsolUserReport.ps1' is not recognized as
the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ GetMsolUserReport.ps1
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (GetMsolUserReport.ps1:String) [
   ], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


Suggestion [3,General]: The command GetMsolUserReport.ps1 was not found, but doe
s exist in the current location. Windows PowerShell does not load commands from
the current location by default. If you trust this command, instead type ".\GetM
solUserReport.ps1". See "get-help about_Command_Precedence" for more details.
PS C:\Office 365 Deployment Tools\Helper Scripts>
0
 
Vasil Michev (MVP)Commented:
Run it like that:

.\GetMsolUserReport.ps1


Or simply drag-drop the file into PowerShell window.

Also make sure you have allowed scripts:

Set-executionPolicy RemoteSigned
0
 
Stelian StanCommented:
To run that you need to Connect Windows PowerShell to the Service: http://help.outlook.com/en-us/140/cc952755.aspx
0
 
ACS2012Author Commented:
C:\Office 365 Deployment Tools\Helper Scripts> $LiveCred = Get-Credential

C:\Office 365 Deployment Tools\Helper Scripts> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

C:\Office 365 Deployment Tools\Helper Scripts> Import-PSSession $Session

i run the above command, then i run:
C:\Office 365 Deployment Tools\Helper Scripts> .\GetMsolUserReport.ps1



i got the following error:
PS C:\Office 365 Deployment Tools\Helper Scripts> .\GetMsolUserReport.ps1
.\GetMsolUserReport.ps1 : File C:\Office 365 Deployment Tools\Helper
Scripts\GetMsolUserReport.ps1 cannot be loaded because running scripts is
disabled on this system. For more information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\GetMsolUserReport.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

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

i read something about a 64bit and it's not working with it:
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/964636ad-347e-4b23-8f7a-f36a558115dd/
0
 
Stelian StanCommented:
I guess you need to change your execution policy, type:
         Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

ans set the execution policy in a particular scope:
        Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

or

Remove the execution policy:
        Set-ExecutionPolicy Undefined
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now