Monday, September 23, 2019

Dynamic 365 license assigned users details


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Below Powershell script can be used to get the Dynamic 365 license user with date assigned 
# License details can be seen from https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/licensing-service-plan-reference

Import-Module MSOnline

$AzureAdCred = Get-Credential
Connect-MsolService -Credential $AzureAdCred

Connect-AzureAD -Credential $AzureAdCred


$Datetime= Get-Date -Format dd_MM_yyyy_HH.mm.ss
 $LogFileName=([string]::Concat("C:\Temp\Output_D365_CustoemrEngagement_License-Activated " , $Datetime ,".csv"))
 New-Item  $LogFileName  -ItemType file

Add-Content $LogFileName -Value ([string]::Concat("User email" +","+ "License Assigned date"))

 Write-Host "Getting all user start.."

$users = Get-MsolUser -all | Where isLicensed -EQ $true
Write-Host "Getting all user done.."
Write-Host "Start serarching for license.."

Foreach ($user in $users)

{
    $intFlag = 0
    $assignedplans = (Get-AzureADuser -ObjectId $user.UserPrincipalName).assignedplans

    #$assignedplans = (Get-AzureADUser -Filter "userPrincipalName eq 'admin.sanjiv.kumar@Test.onmicrosoft.com'").assignedplans
    
    foreach ($assignedplan in $assignedplans)

    {

      # Customre engagement license     

       If (($assignedplan.ServicePlanId -eq "d56f3deb-50d8-465a-bedb-f079817ccac1") -and ($assignedplan.CapabilityStatus -eq "Enabled"))# Customre engagement license

        {

            Write-Host "$user.UserPrincipalName"+"--"+"$assignedplan.AssignedTimestamp" -ForegroundColor White
            Add-Content $LogFileName -Value ([string]::Concat($($user.UserPrincipalName) +","+ $($assignedplan.AssignedTimestamp)+","+ "DYNAMICS 365 CUSTOMER ENGAGEMENT License" ))
           

        }

        #Team member license
        If (($assignedplan.ServicePlanId -eq "f5aa7b45-8a36-4cd1-bc37-5d06dea98645") -and ($assignedplan.CapabilityStatus -eq "Enabled")) #Team member license

        {
         
            Write-Host "$user.UserPrincipalName"+"--"+"$assignedplan.AssignedTimestamp" -ForegroundColor Yellow  
            Add-Content $LogFileName -Value ([string]::Concat($($user.UserPrincipalName) +","+ $($assignedplan.AssignedTimestamp)+","+ "DYNAMICS 365 Team Member License " ))
           

        }

    }

    

}

SKU for office 365

SKUID;SKUName
BI_AZURE_P0;Power BI (free)
BI_AZURE_P2;Power BI Pro
WIN10_PRO_ENT_SUB;Windows 10 Enterprise E5
INTUNE_O365;Intune
VISIOONLINE;Visio Online Plan 2
POWERFLOWSFREE;PowerApps and Logic Flows
PROJECTWORKMANAGEMENT;Office 365 Enterprise E3
EXCHANGE_S_ENTERPRISE;Office 365 Enterprise E3
BPOS_S_TODO_2;Office 365 Enterprise E3
FORMS_PLAN_E3;Office 365 Enterprise E3
YAMMER_ENTERPRISE;Office 365 Enterprise E3
MCOSTANDARD;Office 365 Enterprise E3
FLOW_O365_P2;Office 365 Enterprise E3
SWAY;Office 365 Enterprise E3
TEAMS1;Office 365 Enterprise E3
OFFICESUBSCRIPTION;Office 365 Enterprise E3
STREAM_O365_E3;Office 365 Enterprise E3
Deskless;Office 365 Enterprise E3
POWERAPPS_O365_P2;Office 365 Enterprise E3
Microsoft Stream;Microsoft Stream Trial
DYN365_ENTERPRISE_P1;Dynamics 365 Customer Engagement Plan
POWERAPPS_P2_VIRAL;Microsoft PowerApps Plan 2 Trial (d5368ca3-357e-4acb-9c21-8495fb025d1f)
FLOW_P2_VIRAL_REAL;Microsoft PowerApps Plan 2 Trial (d20bfa21-e9ae-43fc-93c2-20783f0840c3)
FLOW_P2_VIRAL;Microsoft Flow Free (50e68c76-46c6-4674-81f9-75456511b170)
DYN365_CDS_VIRAL;Microsoft Flow Free (17ab22cd-a0b3-4536-910a-cb6eb12696c0)
EXCHANGE_S_STANDARD;Exchange Online (Plan 1)
AAD_PREMIUM;Enterprise Mobility + Security E3
ADALLOM_S_DISCOVERY;Enterprise Mobility + Security E3
RMS_S_PREMIUM;Enterprise Mobility + Security E3
MFA_PREMIUM;Enterprise Mobility + Security E3
INTUNE_A;Enterprise Mobility + Security E3
Dynamics_365_Hiring_Free_PLAN;Dynamics 365 for Talent
DYN365_CDS_DYN_APPS;Dynamics 365 for Talent
POWERAPPS_DYN_APPS;Dynamics 365 for Talent
Dynamics_365_for_HCM_Trial;Dynamics 365 for Talent
FLOW_DYN_APPS;Dynamics 365 for Talent
Dynamics_365_Onboarding_Free_PLAN;Dynamics 365 for Talent
DYN365_BUSINESS_Marketing;Dynamics 365 for Marketing
MCOMEETADV;Audio Conferencing
SPZA;AppConnect
AAD_BASIC;Azure Active Directory Basic
POWERVIDEOSFREE;PowerApps and Logic Flows
POWERFLOWSFREE;PowerApps and Logic Flows
POWERAPPSFREE;PowerApps and Logic Flows
PROJECT_PROFESSIONAL;Project Online Professional
SHAREPOINT_PROJECT;Project Online Professional
PROJECT_CLIENT_SUBSCRIPTION;Project Online Professional

Thursday, September 12, 2019

How to fetch Office 365 PowerBI License users using powershell



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Formatting using : http://hilite.me/
# Run this script in PowerShell ISE 64 bit
#Use Global Admin credential while prompts.


Import-Module MSOnline

$AzureAdCred = Get-Credential
Connect-MsolService -Credential $AzureAdCred

Connect-AzureAD -Credential $AzureAdCred


$Datetime= Get-Date -Format dd_MM_yyyy_HH.mm.ss
 $LogFileName=([string]::Concat("C:\Temp\Output_O365-E3License-Users_With_PowerBI-Activated " , $Datetime ,".csv"))
 New-Item  $LogFileName  -ItemType file

Add-Content $LogFileName -Value ([string]::Concat("User email" +","+ "License Assigned date"))

$users = Get-MsolUser -all | Where isLicensed -EQ $true


Foreach ($user in $users)

{
    $intFlag = 0
    $assignedplans = (Get-AzureADuser -ObjectId $user.UserPrincipalName).assignedplans

    foreach ($assignedplan in $assignedplans)

    {

        #Write-Host "$($assignedplan.service) "-ForegroundColor White
        # For : Forms use "OfficeForms" and for SharePoint use "SharePoint".

        If (($assignedplan.service -eq "PowerBI"))

        {

            Write-Host $user.UserPrincipalName -ForegroundColor White
            Add-Content $LogFileName -Value ([string]::Concat($($user.UserPrincipalName) +","+ $($assignedplan.AssignedTimestamp) ))
           

        }

    }

    

}



Value Service Friendly Name
ProcessSimple Flow for Office365
PowerAppsService PowerApps for Office 365
TeamspaceAPI Microsoft Teams
ProjectWorkManagement Microsoft Planner
Sway Sway
YammerEnterprise Yammer
MicrosoftOffice Office 365 ProPlus
MicrosoftCommunicationsOnline Skype for Business Online
SharePoint SharePoint Online
exchange Exchange Online
Deskless Staff Hub
RMSOnline Azure Information Protection Plan
Azure Rights Management
MultiFactorService Azure Multi-Factor Authentication
AADPremiumService Azure Active Directory Premium
SCO Intune A Direct
Adallom Microsoft Cloud App Security
VolumeLicensing Microsoft Business Center



http://www.wrish.com/post/assign-ems-licenses-with-dynamic-groups/



Monday, September 2, 2019

How to find the users in Office 365 E3 License with "Forms" activated


 1

60
61
# Formatting using : http://hilite.me/
# Run this script in PowerShell ISE 64 bit
#Use Global Admin credential while prompts.

Set-ExecutionPolicy unrestricted
Install-Module MSOnline
Import-Module MSOnline

$AzureAdCred = Get-Credential
Connect-MsolService -Credential $AzureAdCred

Connect-AzureAD -Credential $AzureAdCred


$Datetime= Get-Date -Format dd_MM_yyyy_HH.mm.ss
 $LogFileName=([string]::Concat("C:\Temp\Output_O365-E3License-Users_Without_SharePoint-Activated " , $Datetime ,".csv"))
 New-Item  $LogFileName  -ItemType file

Add-Content $LogFileName -Value ([string]::Concat("User Name" +","+ "User Prinicpal Name" +","+ "Usage Location"))

$users = Get-MsolUser -all | Where isLicensed -EQ $true
$intFlag =0

Foreach ($user in $users)

{
    $intFlag = 0
    $assignedplans = (Get-AzureADuser -ObjectId $user.UserPrincipalName).assignedplans

    foreach ($assignedplan in $assignedplans)

    {

        #Write-Host "$($assignedplan.service) "-ForegroundColor White
        # For : Forms use "OfficeForms" and for SharePoint use "SharePoint".
If (($assignedplan.service -eq "SharePoint")) { $intFlag = 1 } } If($intFlag -eq 0) { Write-Host "$($user.UserPrincipalName) "-ForegroundColor Green Add-Content $LogFileName -Value ([string]::Concat($($user.DisplayName) +","+ $($user.UserPrincipalName) +","+ $($user.UsageLocation))) $intFlag = 0 } }

Wednesday, July 31, 2019

Azure SSO changes for Google

Azure SSO changes for Google


1.Sign on URL :https://www.google.com/a/<domain>/ServiceLogin?continue=https://apps.google.com/user/hub
2.Identifier (Entity ID) : google.com/a/<DOMAIN>
3.User Attributes & Claims Unique User Identifier = user.userprincipalname

Saturday, July 27, 2019

How to add office 365 users in Office 365 groups = Group type "Office 365"


Script to bulk upload user to use Office 365 Group of type "Office 365" Not "Security".

1) Create a CSV file with colum name  "UserPrincipalName"
Add all the email, which needs Microsoft 365 license .


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Create credential object
$credObject = Get-Credential
#Import the Exchange Online ps session
$ExchOnlineSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credObject -Authentication Basic -AllowRedirection
Import-PSSession $ExchOnlineSession

Import-CSv -Path “C:\Users\sanjivk\D365\Assisgn Bulk license script\Assign D365 license user 1.0.CSV” | ForEach {

$UPN=$_.UserPrincipalName

Write-Host $UPN
Add-UnifiedGroupLinks –Identity "D365Prod-CR Account Configuration Team-OSG" –LinkType Members  –Links $UPN
}

Friday, July 19, 2019

How to add office 365 users in Office 365 security groups = Group type "Security"

Script to bulk upload user to use Office 365 Group of type "Security" Not "Office 365".

1) Create a CSV file with colum name  "UserPrincipalName"
Add all the email, which needs Microsoft 365 license .



Set-ExecutionPolicy unrestricted
Install-Module MSOnline
$AzureAdCred = Get-Credential
Connect-MsolService -Credential $AzureAdCred


Import-CSv -Path D:\Assign D365 license user 1.0.CSV | ForEach {

$UPN=$_.UserPrincipalName

$Users=Get-MsolUser -UserPrincipalName $UPN

# Get the Security Group id from Azure Ad 

$Groupid = Get-MsolGroup -ObjectId 1349607e-825a-45d0-b3a2-068de8f6

$Users | ForEach {Add-MsolGroupMember -GroupObjectId $GroupID.ObjectID -GroupMemberObjectId $Users.ObjectID -GroupMemberType User}

}


Tuesday, May 21, 2019

Office 365 Password never expire change for Single user


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Get the office 365 credential
$AzureAdCred = Get-Credential
Connect-MsolService -Credential $AzureAdCred
Connect-AzureAD -Credential $AzureAdCred

# Below powershell command is used to set the PasswordNeverExpires to True.
Set-MsolUser -UserPrincipalName sanjiv@softpoc.com -PasswordNeverExpires $true

# Below powershell command is used to Get the PasswordNeverExpires status for individual user.
Get-AzureADUser -ObjectId sanjiv@softpoc.com | Select-Object UserprincipalName,@{

    N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}

 }

Thursday, May 9, 2019

Get SharePoint Online all site collection details using power shell

   # If you find error related with  Connect-SPOService . You need to download and install the SharePoint Online Management Shell : DOWNLOAD

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
$SPOModulePath = 'C:\Program Files\SharePoint Online Management Shell\'
$adminUPN = 'Admin.User@softPOC.com'
$orgName = 'SOFTPOC'

$userCredential = Get-Credential -UserName $adminUPN
$Env:PSModulePath = '{0};{1}' -f $Env:PSModulePath, $SPOModulePath
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
$uri = "https://$orgName-admin.sharepoint.com"
Connect-SPOService -Url $uri -Credential $userCredential
$sites = Get-SPOSite -Limit All
$sites | select url,owner

# Create a folder with name Temp in C:\ drive
$CSVpath = "C:\Temp\SharePoint-SiteCollection-Report-New.csv"
$sites | Export-CSV -Path $CSVpath -Append -NoTypeInformation

HTML

Script:

JS