Link to home
Start Free TrialLog in
Avatar of ACS2012
ACS2012

asked on

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?
Avatar of Stelian Stan
Stelian Stan
Flag of Canada image

Run the following command:

Get-MsolUser | select DisplayName,UserPrincipalName |export-csv –path C:\users.csv
Avatar of ACS2012
ACS2012

ASKER

then how I can connect using powershell??
SOLUTION
Avatar of Vasil Michev (MVP)
Vasil Michev (MVP)
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ACS2012

ASKER

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>
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ACS2012

ASKER

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/
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial