Share via


How to find user authentication in office 365 using powershell commands

Question

Monday, April 15, 2013 10:01 AM

Hi,

Office 365 is implemented in my organization.

I want to know how to find the authentication of users in Office 365 using powershell commands when users try  to login using lync or exchange online or any client applications.

Please suggest.

All replies (7)

Thursday, April 18, 2013 5:26 AM ✅Answered

Hi,

Use powershell to manage office 365, I would like to suggest you refer to the below article:

http://technet.microsoft.com/en-us/magazine/hh750396.aspx

Hope this helps.

Regards,

Yan Li

Cataleya Li
TechNet Community Support


Tuesday, April 16, 2013 7:32 AM

Can anyone please suggest on this query. Is there any way  to find the authentication of users using command mode in office 365. 


Tuesday, April 16, 2013 8:42 AM

I'm not sure I understand what you're asking. Are you after the property used as a login name or are you trying to log authentication attempts or something else entirely?

If it's the first one you want then this will help:

(Use your Office365 credentials when prompted)

$cred = Get-Credential
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic -AllowRedirection

Import-PSSession $session

Get-User | Select UserPrincipalName

Wednesday, April 17, 2013 6:43 AM

Hi Callum,

Thanks for your update but I am not looking for the above commands. My query is there any powerShell scripts or commands which can periodically perform authentication in office 365 mailbox.


Thursday, May 16, 2013 3:37 PM

I believe he wants to know when his users sign into different clients .

such as OWA, Lync, Outlook ..


Thursday, May 16, 2013 4:11 PM

I believe he wants  Logon statstics:

Make a .csv file with your list of users & import & define the variable $csv :

$csv  |  foreach {Get-logonStatistics -Identity $_.upn} | select * |out-gridview


Thursday, May 16, 2013 6:48 PM

Before yyou run the logon stats you'll need to connect to the Exccange Remote powershell

To connect to the Exchange powershell with stored credential:

$SecPass1=convertto-securestring-asplaintext-string"Password!!"-force

$MSOLM=new-objectSystem.Management.Automation.PSCredential-argumentlist"[email protected]",$SecPass1

$Session=New-PSSession-ConfigurationNameMicrosoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/*-Credential*$MSOLM*-Authentication*Basic*-AllowRedirection*

Import-ModuleMSOnline

Import-PSSession$Session*–AllowClobber*