Enable Azure MFA by changing user state - azure-active-directory

Trying to activate MFA per user as described here https://learn.microsoft.com/en-us/azure/active-directory/authentication/howto-mfa-userstates#enable-azure-mfa-by-changing-user-state however
via UI => Selecting the user does not show the quick steps to Enable.
via PowerShell => Successfully installed Install-Module MSOnline but then Connect-MsolService runs into Connect-MsolService : The term 'Connect-MsolService' is not recognized as the name of a cmdlet, function, script file, or operable program.
List item
How can MFA be enabled per user in AAD?

There is no quick steps to enable mfa for guest users via this UI.
If you choose your tenant users, the button will show up.
If you want to enforce multi-factor authentication for B2B guest users, you can follow this tutorial.

Related

Disable Azure AD MFA Interrupt Mode for a group of users

I'm creating a set of hands-on lab users in my Azure AD for access to Azure Labs. We will reuse these user accounts (and reset the passwords after every lab session).
My challenge is that these users are being required to configure MFA. Which I THINK is called the Azure AD Interrupt Mode described here.
Is there a way to exclude these group of users from being required to set this up?
I think this can be disabled entirely by navigating to Azure AD - Default Directory - Properties - Manage Security Defaults (right at the bottom of the page) - Enable Security Defaults - set it to No.
If it's per user basis, then Navigate to Azure AD - All users - Per User MFA - this will list all the users and then you can select "n" number of them to either enable or disable MFA.
// Answering my own question and hope it helps someone.
The first and obvious step is to disable MFA. This is described in this link: https://learn.microsoft.com/en-us/azure/active-directory/authentication/howto-mfa-userstates
After this, however, you may still face the interrupt wizard as shared in the screenshot of the question above. This is due to Self-Service Password Reset (SSPR) being enabled. If SSPR is enabled, then MFA is still required for them to be able to do a password reset.
Solution 1: If you want SSPR enabled, then create a Conditional Access policy requiring MFA upon sign in.
This way, MFA is only triggered when user wants to do an SSPR.
For this lab user scenario, you will still have to set-up MFA one-time for each of the users (you may use the same contact details).
Extra note: I tried setting the MFA details by bulk using PowerShell. However, it is not possible to set an MSOL user object's StrongAuthenticationUserDetails property.
Solution 2: Disable SSPR or limit to selected users using AD groups
Don't include the lab users in the selected users group. Since SSPR is not allowed for these users, the extra MFA details won't be asked of these users anymore.
Drawback: The setting is to include user groups which should have SSPR. There's no option to exclude just the lab users.
Solution 2 works for me but may not work for everyone.

How to get event logs on Windows Active Directory Server for actions performed on user accounts

On a Windows Active Directory server, we can perform several actions on the accounts like add account, enable, disable, reset account, reset password etc.
Is there anyway that I can get an event log of any such actions that were performed on the accounts?
eg: If one of my computer/system say comp1 has an account listed on my AD server. If I log into my AD server and I do a "Reset Account" for my computer/system comp1 which is listed on there. Is this event logged anywhere so that if I search in the event log, I see that a "Reset Account" action was performed for comp1 ? How and where can I get those event logs ?
Thank you in advance for any help.
You can enable logging via group policy, below link will give you step by step details on activating this, at least I think it will be a good place to start. https://blogs.msdn.microsoft.com/servergeeks/2014/07/16/auditing-active-directory/

Identify admin permissions required by an Azure AD app registration

How can I find out what admin permissions are blocking the user from signing in to an Azure AD app?
I am setting up an App Registration in the Azure AD portal to be used with my Service Fabric cluster. The app registration does basic auth and only has one Required Permission configured: Sign in and read user profile (which does NOT require admin permission).
My tenant has the "Users can consent to apps accessing company data on their behalf" setting to "Yes", so it's not that.
Also, the /authorize request doesn't have any resource parameter, so it's implicitly asking for the permission I configured: Azure AD's Sign in and read user profile.
However when an non-admin user attempts to sign it, I still get the error:
AADSTS90094: The grant requires admin permission
I reproduced the scenario and this is what I observed. Found a workaround, hope it helps.
First I created a Service Fabric (SF) cluster secured with AAD authentication using the steps described here, using an AAD tenant where I am not a global admin.
Then I tried to login to Service Fabric Explorer (SFX) and I got this error:
AADSTS50105: The signed in user is not assigned to a role for the
application 'f8c79129-deb7-4a21-a6e0-ec29e88298ef'
This is expected, because the user must be assigned to a role (Admin or ReadOnly) in the SF application that represents the cluster. So I went to AAD > Enterprise Applications > found my cluster app and under Users and Groups I added myself to the Admin role. Notice that the fact that a regular user can administer the roles of an application that the user owns is something new, it's available since a month or so -- before that, a regular user couldn't administer the roles of an application.
Then I tried to login again to SFX and I got a different error:
AADSTS65005: Invalid resource. The client has requested access to a
resource which is not listed in the requested permissions in the
client's application registration. Client app ID:
f8c79129-deb7-4a21-a6e0-ec29e88298ef. Resource value from request: .
Resource app ID: 00000002-0000-0000-c000-000000000000. List of valid
resources from app registration: .
00000002-0000-0000-c000-000000000000 is Windows Azure Active Directory. For some reason SetupApplications.ps1 doesn't assign the Sign in and Read User Profile permission to the SF cluster application. So I edited the application and I assigned that permission, just like you showed in your print screen. Notice that SetupApplications.ps1 has a parameter AddResourceAccess (not mentioned in the doc) that adds that permission, not sure why it doesn't add it by default. Perhaps it isn't needed when you run SetupApplications.ps1 as a global admin, and the scripts/doc assumes that you are a global admin.
Then I tried to login to SFX again and I got the same error that you observed:
AADSTS90094: The grant requires admin permission.
So I checked the SF application under AAD > Enterprise Applications > found the SF cluster app > Properties. User assignment required is configured "Yes". I changed it to "No" and tried to login to SFX. This time it worked OK, I could consent and access the SFX console. Then I changed User assignment required again to "Yes".
One can argue if the SF app really needs User assignment required > Yes because anyway if a user is not assigned to the Admin or ReadOnly role, SFX will try to fallback to client certificate authentication.
In either way, the AAD behavior is confusing. At least, the error should be more descriptive and point to the User assignment configuration. Perhaps the current behavior has to do with what I mentioned before, that regular users can now administer roles. Perhaps the behavior is being improved.

Joomla Easysocial user auto approvals while registration

I am using Easysocial Extension on my Joomla 3.0 site. i was able to successfully install and integrate it. But when ever a user get register i have to approve them to use the site. And don't want to approve every user, i want it in a auto mode. I have tried to Change the option for "New User Account Activation" to "None" under User Manager but No go. I have searcher for other options in Easysocial but not found any.
Can any one help in resolving this issue.
Do the following:
Login to the admin panel of the Joomla Back-end
Go to: Component > Easysocial > Settings > Profile types
Select your members group
Go to the Registration tab
Select Registration Type and Oauth Registration type (various options are there)
This may work, set these preferences in Joomla users > options
Allow user registration - Yes
New user registration Group - Registered
New User Account activation - Self
User will now need to click an activation link which will then authenticate them.

Login and Logout AD with C#

How can i login without logout from current user to another Active Directory user with C#. ;
1-Getting new user's access
2- doing my work and than logout with c# same way.
For example i am a user at blabla.com domain.I have logged in a Power User.But i need Admin Rights for something so i need to logout and change user to Administrator do my job and relogin with Power User again.I wanna do it with C#.
I heard something like that Impersonate User but i think this is not what i want.
Edited : I want login with another user and get this user's permissions without logout from my current user in c#.
Your question is not very clear. If what you want to be doing is querying/modifying AD, then t4zsan's answer is correct.
If you just need the other user's groups/security permissions, then Impersonation is the way to go. This article will give you a good foundation on it.
Caveats: The user you wish to impersonate must be able to logon to the machine you are running the code on. You can't impersonate a user in another domain if that domain is not trusted. Nor can you impersonate a local user on another machine, obviously.
When using the classes in System.DirectoryServices to connect to AD you have the option of specifying user credentials. For example when using DirectoryEntry there is a constructor overload taking username and password that lets you connect as a different user.

Resources