azure-ad-license-status.psm1
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 | Set-StrictMode-Version3.0 #region: CSS configuration #region: Helper functions modeWrite a message{ $formattedMessage="[$([datetime]::Now.ToString('yyyy-MM-dd HH:mm:dd'))] $([string]::new('-', $nestingLevel)) $Message" modeAdd-Exit{ # Logging modeAdd-Result{ # Logging modeGet-AADGroupMembers{ # Logging modeGet-EXOGroupMembers{ # Logging modeResolve-ATPRecipients{ # Logging modeGet-ATPRrecipients{ # Logging modeGet-SKUName{ # Logging modeGet-AzureADLicenseStatus{ [CmdletBinding(Seat reservation=$false)] Initialization-Variables #region: Users #region: Advanced #region: Reference Basic control - Products Check the number of licenses for the following product SKUs andholdadditional licenses:
for each($SKUin$results['SKU'].Keys){ $differenceCount=$results['SKU'][$SKU]['availableCount']-$results['SKU'][$SKU]['minimumCount'] Add-Exit-Production" $(Get-SKUName -SKUID $SKU) | `$($results['SKU'][$SKU]['availableCount']) | `$($results['SKU'][$SKU]['minimumCount']) | "if($results['SKU'][$SKU]['availableCount']/$results['SKU'][$SKU]['minimumCount']*100-ge$SKUWarningThreshold_basic){ Add-Exit-Production" | $differenceCount | "$differenceCount | "$differenceCount | "
The following criteria were used during the audit:
- `
- Check products with >$SKUIgnoreThreshold total permissions `
- Report normal products that have both <$SKUTotalThreshold_normal licenses and <$SKUPercentageThreshold_normal% of their total available licenses `
- Report important products that have both <$SKUTotalThreshold_important licenses and <$SKUPercentageThreshold_important% of their total available licenses
}
elsewhere{
Add-Exit-Production'Nothing to report'
}
# Export advanced SKU results
Add-Exit-Production'
Advanced control - Products
if($results.ContainsKey('Advanced')){
Add-Exit-Production"
Check the number of licenses for the following product SKUs andholdadditional licenses:
`License type | Activated crowd | Required crowd | Difference |
---|
for each($planin$results['Advanced'].Keys){
$differenceCount=$results['Advanced'][$plan]["enabledCount"]-$results['Advanced'][$plan]['neededCount']
Add-Exit-Production"
if($results['Advanced'][$plan]["enabledCount"]/$results['Advanced'][$plan]['neededCount']*100-ge$SKUWarningThreshold_advanced){
Add-Exit-Production"
}
otherif($results['Advanced'][$plan]["enabledCount"]/$results['Advanced'][$plan]['neededCount']*100- The$SKUCriticalThreshold_advanced){
$critical=$truth
Add-Exit-Production"
}
elsewhere{
Add-Exit-Production"
}
Add-Exit-Production""
}
Add-Exit-Production
The following criteria were used during the review:
- check itAzure AD P1based on groups using dynamic user subscription
- check itAzure AD P1based on applications that use group-based assignment
- check itAzure AD P1based on users covered by Conditional Access
- check itAzure AD P2based on users in the Privileged Identity Management field
- Select itDefender for Office 365 P1/P2based on Exchange Online protected recipients
}
elsewhere{
Add-Exit-Production'Nothing to report'
}
# Extract basic user results
Add-Exit-Production'
Basic control - Users
'if($results.ContainsKey('User')){
Add-Exit-Production«
Review the permission assignments for the following user accounts and mitigate the impact:
Account | Interchangeable | Optimizeable | Removed |
---|
for each($userin$results['User'].Keys|Classification-Object){
Add-Exit-Production"
Where-Object{$null -ne $_} |
ForEach-Object{Get-SKUName -SKUID $_} |
Sort-Object) -join '
')
Where-Object{$null -ne $_} |
ForEach-Object{Get-SKUName -SKUID $_} |
Sort-Object) -join '
')
Where-Object{$null -ne $_} |
ForEach-Object{Get-SKUName -SKUID $_} |
Sort-Object) -join '
')
}
Add-Exit-Production
The following criteria were used during the review:
- Check accounts with any number of assigned licenses
- Report theoretically exclusive licenses asinterchangeable, based on specified SKUs
- Please refer to practice licenses asoptimisable, based on available SKU features
- Do list the licenses asremovable, based on enabled SKU features
}
elsewhere{
Add-Exit-Production'Nothing to report'
}
# Configure and send email
$email=@{
'message'=@{
'theme'="Azure AD permissions need attention";
'significant'='normal';
'body'=@{
'Content Type'='HTML';
'content'=$outputs.ToString()
};
}
}
$email['message'].Addition("to Recipients",[System.Collections.Generic.List[hashtable]]::young())
for each($recipientAddressin$RecipientAddresses_normal){
$email['message']["to Recipients"].Addition(@{
'email adress'=@{
'address'=$recipientAddress
}
})
}
if($critical){
$email['message']['theme']="Azure AD licenses need urgent attention"
$email['message']['significant']='high'
$email['message'].Addition('ccRecipients',[System.Collections.Generic.List[hashtable]]::young())
for each($recipientAddressin$RecipientAddresses_critical){
$email['message']['ccRecipients'].Addition(@{
'email adress'=@{
'address'=$recipientAddress
}
})
}
}
Invoke-MgGraphRequest-MethodPOSITION-Houri("https://graph.microsoft.com/v1.0/users/{0}/sendMail"- eat$SenderAddress)-Body$email-Type of content'application/json'
}
#endregion
Disconnect-MgGraph|Out-Null
}
}
FAQs
What is P1 and P2 license in Azure? ›
A standalone Azure Premium P1 license costs $6 per user / per month, whereas Azure Premium P2 license cost $9 per user / per month. All member user accounts in the Azure AD tenant must be licensed. If your organization licenses Microsoft 365, then Microsoft 365 E3 licenses include Azure Active Directory Premium P1.
What is the minimum version of Microsoft Azure Active Directory AD for MFA? ›To continue utilizing Azure Active Directory authentication with MFA, you need SSMS 18.6 or later.
What's the difference between Azure AD Premium P1 vs P2? ›Azure AD Premium P2 includes all of the features of Azure AD Premium P1 - plus a few more useful capabilities, such as Identity Protection and Privileged Identity Management (PIM).
How do I check my Azure AD license status? ›Sign in to the Azure portal using a License administrator account in your Azure AD organization. Select Azure Active Directory, and then select Licenses. Select All products to view the All Products page and to see the Total, Assigned, Available, and Expiring soon numbers for your license plans.
Which PowerShell command is used to authenticate to Azure? ›To sign in interactively, use the Connect-AzAccount cmdlet. This cmdlet presents an interactive browser based login prompt by default.
Does every user need a P1 license? ›Yes, the requirement is that the Azure AD Premium P1 license is applied to all users who make use of the feature. Azure AD has always been licensed per user and this applies to all Azure AD features. A proper license is required if a user benefits directly or indirectly from any feature covered by that license.
What is the difference between P1 and P2 license? ›Once you've held your P1 licence for at least 12 months, the next step is getting your P2 licence (green Ps). You'll still have restrictions on your green Ps, but some of those restrictions will be different. You can either: apply for a P2 licence onlinelaunch.
How do I activate my P2 license in Azure? ›If you have access to the free Azure AD Premium P2, go to the Directory + subscription filter > select the correct Azure Active Directory tenant. Then go to Azure Active Directory > Licenses > Overview. In the top right under "Quick tasks" select "Get a free trial." Select Azure AD Premium P2 and select Activate.
How many Azure AD licenses do I need? ›Generally, you need to purchase one license per user, which allows up to 10 services, so if you have 100 users in your organization, then you would need 100 licenses. If you need more than 10 services, then you will need to purchase additional licenses.
Does Azure AD require MFA to join? ›To secure user sign-in events in Azure AD, you can require multi-factor authentication (MFA). Enabling Azure AD Multi-Factor Authentication using Conditional Access policies is the recommended approach to protect users.
What is the highest role in Azure AD? ›
The Azure AD roles include: Global administrator – the highest level of access, including the ability to grant administrator access to other users and to reset other administrator's passwords.
Does every user need a Azure P2 license? ›For more info. Note: Many Azure Active Directory (Azure AD) services require you to license each of your users or groups (and associated members) for that service. Only users with active licenses will be able to access and use the licensed Azure AD services for which that's true.
What does P1 license include? ›Azure AD Premium P1 offers the following features: All of the features listed for Azure AD Microsoft 365 apps. SSO for an unlimited number of pre-integrated SaaS applications. Self-service application assignment to enable users to self-discover and request access to applications; this enables cloud app discovery.
How do I upgrade my Azure AD P1 to P2? ›- Purchase Azure AD P1 or P2 licenses. Select Billing --> Purchase services. ...
- Once you have purchased the correct number of addon licenses, you must assign them to a particular account. Go back to the admin console and select Users --> Active users. ...
- You're done!
To list all of the users in your subscription, use the Get-AzureAdUser -All $true command.
How do I check my Microsoft license status? ›Click Settings, and then under My app settings, choose Office 365. On the My account page, choose Subscriptions. You'll see the services that you're licensed to use, such as the latest desktop version of Microsoft 365, SharePoint in Microsoft 365 or OneDrive for work or school, and Exchange Online.
How do I check my license server status? ›- SystemInfo.
- Type SLMGR and type all commands your query needs.
Open Windows PowerShell. Enter dsregcmd /status . Verify that both AzureAdJoined and DomainJoined are set to YES. You can use the DeviceId and compare the status on the service using either the Azure portal or PowerShell.
How do I authenticate in PowerShell? ›To sign in interactively, use the Connect-SecMgmtAccount cmdlet. When you run this cmdlet it will open a browser where you will be able to authenticate. If the system you are using to connect does not a browser, then you will be provided a code.
What are Azure PowerShell commands? ›Task | Command |
---|---|
Start a VM | Start-AzVM -ResourceGroupName $myResourceGroup -Name $myVM |
Stop a VM | Stop-AzVM -ResourceGroupName $myResourceGroup -Name $myVM |
Restart a running VM | Restart-AzVM -ResourceGroupName $myResourceGroup -Name $myVM |
Delete a VM | Remove-AzVM -ResourceGroupName $myResourceGroup -Name $myVM |
How do I get my Azure AD P1 license? ›
- Purchase Azure AD P1 or P2 licenses. Select Billing --> Purchase services. ...
- Once you have purchased the correct number of addon licenses, you must assign them to a particular account. ...
- You're done!
Azure Active Directory comes in four editions—Free, Office 365 apps, Premium P1, and Premium P2. The Free edition is included with a subscription of a commercial online service, e.g. Azure, Dynamics 365, Intune and Power Platform.
Is Azure Active Directory Premium P1 per user? ›In this example, you can meet the requirement by using dynamic group memberships to automatically assign user licenses and security permissions to users, based on their group membership. An Azure Active Directory Premium P1 license should be assigned to each user affected by dynamic group membership.
Is P1 higher than P2? ›To answer the question, P1 and P2 refer to the level at which you passed the specific subject at. For example, P1 means pass at Level 1 and therefore P2 means pass at Level 2.
What is the difference between P and P1? ›There are two kinds of probationary licence in Victoria: P1 (red P plate), which lasts for at least the first 12 months of probationary driving. P2 (green P plate), which normally starts 12 months from when you get your P1 licence and lasts for at least three years.
Does P1 license include teams? ›Microsoft is adding Azure AD Premium P1 to the Microsoft Teams Room standard and Premium licences at no additional cost.
How do I know if my Azure AD is P1 or P2? ›To check which edition your Azure AD is capable of, log in to the Azure AD Portal and look in the overview section: Azure AD Free indicates you only have the basic features. Azure AD Premium P1 or P2 will indicate advanced features are available.
How do I upgrade my Azure AD to P2 for free? ›- Sign in to the Azure portal.
- Search for Subscriptions.
- Select the subscription that was created when you signed up for Azure free account.
- In the subscription overview, select Upgrade subscription in the command bar.
Application proxy for on-premises, header-based, and Integrated Windows Authentication. MDM auto-enrollment, self-service BitLocker recovery, additional local admin tooling to Windows Pro devices via Azure AD Join. Role-based access control (RBAC) Risk-based Identity Protection.
What is the limit of Azure AD free? ›By default, a maximum of 50,000 Azure AD resources can be created in a single tenant by users of the Azure Active Directory Free edition. If you have at least one verified domain, the default Azure AD service quota for your organization is extended to 300,000 Azure AD resources.
Do I need a license to join a PC to Azure AD? ›
You must have an Intune license to use Intune to manage the devices. Users must have licenses for Windows, Intune, Azure AD, and Windows 365 to use their Cloud PC.
What are the user limits in Azure AD? ›An Azure AD organization can have a maximum of 5,000 dynamic groups and dynamic administrative units combined. A maximum of 500 role-assignable groups can be created in a single Azure AD organization (tenant). A maximum of 100 users can be owners of a single group.
What license is required for Azure AD join? ›If you just want just basic Azure AD join for your computers, a regular Azure AD or Office 365 subscription is all you need. You can use an existing subscription or set up a new one. That said, if you want to do anything beyond just joining, you will need additional licenses for Endpoint Management/Intune.
What license is required for Azure AD Connect? ›You must have an Azure AD Global Administrator account or Hybrid Identity Administrator account for the Azure AD tenant you want to integrate with.
Does Azure AD require authentication? ›Azure AD Multi-Factor Authentication works by requiring two or more of the following authentication methods: Something you know, typically a password. Something you have, such as a trusted device that is not easily duplicated, like a phone or hardware key. Something you are - biometrics like a fingerprint or face scan.
What is the high salary of Azure? ›Azure Cloud Engineer salary in India ranges between ₹ 3.4 Lakhs to ₹ 14.0 Lakhs with an average annual salary of ₹ 5.9 Lakhs.
What are the three types of Azure AD? ›Azure Active Directory comes in four editions—Free, Office 365 apps, Premium P1, and Premium P2.
What are the 3 types of roles in Microsoft Azure? ›Account Administrator, Service Administrator, and Co-Administrator are the three classic subscription administrator roles in Azure.
Can I bring my own license to Azure? ›Yes, if you have Software Assurance (SA) you can use License Mobility or Azure Hybrid Benefits to "bring-your-own-license" for all Virtual Machines supported server products.
What is the difference between license and subscription in Azure? ›For Microsoft's SaaS cloud offerings, a license allows a specific user account to use the services of the cloud offering. You are charged a fixed monthly fee as part of your subscription. Administrators assign licenses to individual user accounts in the subscription.
Do Azure admins need a license? ›
To use Privileged Identity Management (PIM) in Azure Active Directory (Azure AD), part of Microsoft Entra, a tenant must have a valid license. Licenses must also be assigned to the administrators and relevant users.
Is Azure P1 included in E3? ›EMS E3, Microsoft 365 E3, and Microsoft 365 Business Premium includes Azure AD Premium P1. EMS E5 or Microsoft 365 E5 includes Azure AD Premium P2. You can use the same Conditional Access features noted in the following sections to provide multi-factor authentication to users.
What is the difference between Active Directory and Azure Active Directory? ›AD is great at managing traditional on-premise infrastructure and applications. Azure AD is great at managing user access to cloud applications. You can use both together, or if you want to have a purely cloud based environment you can just use Azure AD.
What is the difference between P2 and E5 license? ›Enterprise Mobility + Security E5
It also offers multifactor authentication (MFA) conditional access and advanced security reporting. P2 includes all of that plus offers Identity Protection and Privileged Identity Management (PIM) and advanced capability concerning identity protection. E5 of course is more expensive.
To activate your license plan
Open the confirmation email you received from Microsoft after you signed up, and then select either Sign In or Sign Up. Sign in. Choose this link if you have an existing tenant, and then sign in using your existing administrator account.
You can also change a user's UPN in the Azure AD admin center by changing their username. And you can change a UPN by using Microsoft PowerShell. A user's UPN (used for signing in) and email address can be different. If you just need to add a new email address for a user, you can add an alias without changing the UPN.
What license includes Azure AD P1? ›Azure AD Premium P1, included with Microsoft 365 E3, offers a free 30-day trial.
How do I authenticate API with Azure AD? ›- Step 1: Create a protected web API. Create a new web API project. ...
- Step 2: Install the dependencies. ...
- Step 3: Initiate the authentication library. ...
- Step 4: Add the endpoints. ...
- Step 5: Configure the web server. ...
- Step 6: Configure the web API. ...
- Step 7: Run and test the web API. ...
- Step 8: Call the web API from your app.
To add an authenticated account for use with Service Management, use the Add-AzureAccount cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions.
How do I pass credentials in PowerShell script? ›The first way to create a credential object is to use the PowerShell cmdlet Get-Credential . When you run without parameters, it prompts you for a username and password. Or you can call the cmdlet with some optional parameters.
How to check Windows activation status using PowerShell? ›
- Use one of the many ways to open Command Prompt or PowerShell on Windows.
- In the console, type slmgr /xpr and press Enter.
- In the dialog box, check Windows 11's activation status.
- Step 1: Create a Secure String. First of all, create a secure string in order to safely store the password in it: ...
- Step 2: Create a PSCredential Object. ...
- Step 3: Use the Credentials Without Being Prompted for a Password.
- Microsoft Authenticator.
- Authenticator Lite (in Outlook)
- Windows Hello for Business.
- FIDO2 security key.
- OATH hardware token (preview)
- OATH software token.
- SMS.
- Voice call.
- To allow Basic authentication for the protocol, use this switch without a value.
- To block Basic authentication for the protocol, use this exact syntax: -AllowBasicAuthActiveSync:$false .
By default, PowerShell Remoting uses Kerberos (if available) or NTLM for authentication. Both of these protocols authenticate to the remote machine without sending credentials to it.
How do I set up Azure AD subscription in PowerShell? ›To change the azure subscription using PowerShell, we can use the Select-AZSubscription command. When you use this command, you can use either the subscription ID, Subscription Name, or the Tenant ID.
How do I Connect to Azure using Windows PowerShell? ›Sign in to Azure
Sign in interactively with the Connect-AzAccount cmdlet. Skip this step if you use Cloud Shell. Your Azure Cloud Shell session is already authenticated for the environment, subscription, and tenant that launched the Cloud Shell session. Beginning with Az PowerShell module version 5.0.
- Sign in to the server you use with enterprise admin permissions.
- Sign in to the Azure portal, and then go to Azure Active Directory.
- On the menu on the left, select Azure AD Connect.
- Select Manage cloud sync.
- At the top, click Download agent.
- Run Windows Powershell.
- type the following command: tnc <Server> - port <PortNumber>
- You need to check the value of TcpTestSucceeded. It gives True if the port is open and false if the port is closed.