Tag Archives: how to

O365 – Export Licensed Users

While reviewing user account licensing status in my Office 365 tenant, I noticed that there is no Export button when the list is filtered by Licensed Users.  I’m not sure why there would not be a button for exporting the list as filtered because there is an Export button when you filter by Unlicensed Users (see screenshots below).

Active users list filtered by License Users — no Export button!  (Click to enlarge.)Licensed Users FilterActive users list filtered by Unlicensed Users — Export button.  (Click to enlarge.)Unlicensed Users Filter

The fix is to export a list using PowerShell!

Export a List of Licensed Users

Open PowerShell and connect to Office 365/MSOL (see instructions here if you have not done this part before).

Type the following code into PowerShell, changing the output file name and location as needed.

$users = Get-MsolUser -All | Where-Object {$_.IsLicensed -eq "TRUE"}
$users | Export-Csv -Path C:\Scripts\O365\LicensedUsers.csv

That’s all there is to it.  Now you have a list of Office 365 Licensed Users in .csv format.

O365 – How to Connect

Sometimes it’s difficult to find the simplest things because they are buried in other data.  Here are two commands that do just one thing–get you connected to your Office 365 account in the cloud.

Connect to Office 365/MSOL

Prerequisites:

  1. Install the 64-bit version of the Microsoft Online Services Sign-in Assistant: Microsoft Online Services Sign-in Assistant for IT Professionals RTW.
  2. Install the 64-bit version of the Windows Azure Active Directory Module for Windows PowerShell: Windows Azure Active Directory Module for Windows PowerShell (64-bit version).

Open the PowerShell ISE with Run as Administrator on your computer.  Type in the code below.  Run the code and enter your O365 user name and password and you’re connected.

$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential
Connect to Office 365/Exchange

Open the PowerShell ISE with Run as Administrator on your computer.  Type in the code below.  Run the code and enter your O365 user name and password.  You will be connected to an Office 365 Exchange session.

$cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication Basic –AllowRedirection
Import-PSSession $Session
Disconnect from Office 365/Exchange

It’s a good practice to remember to disconnect from your O365 Exchange session when you’re done.  Type the code below into your PowerShell session and you will be disconnected.

Remove-PSSession $Session

Now you can add these snippets to any script you create to work in your tenant.  How easy was that?

Remove Navigation Links on WordPress Posts

The posts on my site are not chronological so it makes no sense to have the “previous/next” navigation links.  The best way to remove them is to comment out the code in the single.php file.  Below are the steps I used to remove the navigation links from my posts.  This applies to the WordPress Twenty Fourteen theme, so your code may be different. Continue reading Remove Navigation Links on WordPress Posts

Create A Child Theme in WordPress Twenty Fourteen

The best way to customize a WordPress site is to use a child theme.  That way the customizations are not lost when the parent theme is updated. Additionally, if you make a major mistake changing the files and the site goes down, you can just delete the child theme folder and the site will come right back up using the parent theme. Continue reading Create A Child Theme in WordPress Twenty Fourteen

Get User Account Expiration Date

Our security team implemented a rule that all vendor user accounts must be reviewed and renewed every 30 days.  To facilitate this process, I created a script to automate retrieval of the expiration date of the vendor accounts based on the description and/or title fields which is where the company name of the vendor was stored.  The resulting .csv file was then used to review the accounts and to open a ticket for renewal of the current accounts. Continue reading Get User Account Expiration Date