{"id":499,"date":"2013-10-16T22:37:15","date_gmt":"2013-10-16T22:37:15","guid":{"rendered":"http:\/\/giraffeit.com\/?p=499"},"modified":"2013-10-16T22:37:15","modified_gmt":"2013-10-16T22:37:15","slug":"365","status":"publish","type":"post","link":"https:\/\/giraffeit.com\/index.php\/2013\/10\/16\/365\/","title":{"rendered":"Usernames from Email exchange 365"},"content":{"rendered":"<p>If you have email addresses and need to get usernames ( this is for the cloud based exchange 365 ) :-<\/p>\n<p>Open powershell and :<\/p>\n<p>Import-Module ActiveDirectory<\/p>\n<p>Also logon to Exchange environment Exchange 2010 in the cloud:-<\/p>\n<p>#Logon<\/p>\n<p>$LiveCred = Get-Credential<\/p>\n<p>$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri <a href=\"https:\/\/ps.outlook.com\/powershell\/\">https:\/\/ps.outlook.com\/powershell\/<\/a> -Credential $LiveCred -Authentication Basic -AllowRedirection<\/p>\n<p>Import-PSSession $Session<\/p>\n<p>&nbsp;<\/p>\n<p>Then the script is:-<\/p>\n<p>Get-Content emailtest.csv | %{<\/p>\n<p>Get-Mailbox $_ | Select-Object PrimarySmtpAddress, UserPrincipalName<\/p>\n<p>} | Export-Csv users.csv -NoTypeInformation<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have email addresses and need to get usernames ( this is for the cloud based exchange 365 ) :- Open powershell and : Import-Module ActiveDirectory Also logon to Exchange environment Exchange 2010 in the cloud:- #Logon $LiveCred = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:\/\/ps.outlook.com\/powershell\/ -Credential $LiveCred -Authentication Basic -AllowRedirection Import-PSSession $Session &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/giraffeit.com\/index.php\/2013\/10\/16\/365\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Usernames from Email exchange 365&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-499","post","type-post","status-publish","format-standard","hentry","category-bog"],"_links":{"self":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/posts\/499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/comments?post=499"}],"version-history":[{"count":0,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/posts\/499\/revisions"}],"wp:attachment":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/media?parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/categories?post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/tags?post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}