Get all license users list without specific user

Hi, During clean-up already created licenses users without global admin on office 365, so as to make it with all users without one global admin, I will show some cmdlet and contents.


Let’s see Get-MsolUser cmdlet, if we execute to get all available properties, let me execute Get-MsolUser | Get-Member | Out-GridView , it shows up Grid View format with all properties we can use, AllProperties.pngSo as to get all license user, we can use  Get-MsolUser | Where-Object  {$_.isLicensed -eq “TRUE”} , it retrieves all users with have licenses on this tenant.  If we check $_.xxxxx format, it uses with properties, if we want to export all license users to csv file, we can use  Get-MsolUser | Where-Object {$_.isLicensed -eq “TRUE”} | Export-Csv c:\Licenses.csv


Let’s assume to get all license users without specific user, how can we make cmdlet? It needs to use -and and more condition such as $_.UserPrincipalName -ne “userPrincipalName” ,  if my tenant have global administrator is hongwoo@ysah.org, I want to get all license users without one global administrator, how can I do it?  Get-MsolUser | Where-Object {$_.isLicensed -eq “TRUE” -and $_.UserPrincipalName -ne “hongwoo@ysah.org”}  ,  this statmemt make a result to retrieve all license users without one global administrator.

Advertisements

글쓴이: hongwoo jin

I'm managing our Korea company's Office 365 administrator I want to be MS Office 365 & SharePoint MVP with certification.

답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

Google+ photo

Google+의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

%s에 연결하는 중