White listing groups in azure active directry - active-directory

We would like to enable group expiry for groups in active directory. However for some few sites, we would like to disable this. But in the UI it looks like it is all, or you have to add each group manually. Is there any way to enable for all, but with option to disable some?

AFAIK, currently there is no option available in Azure Portal UI to enable group expiration policy for All by disabling some groups.
As you mentioned you have to manually add the groups by choosing Selected option.
If you want to select all and disable some groups in particular, you can raise a feature request to Azure Support to include that option.
If you don't want to do the above, you can create a CSV file as a workaround.
Make sure the .csv file should contain a column ObjectId that includes IDs of Azure AD Groups on which you want to apply the expiration policy.
Create a expiration policy by choosing selected option.
Make use of above policy ID in the PowerShell script and update by importing the above CSV file like below:
Connect-AzureAD
$policy = "your_policy_id"
$groups = import-csv ".\your_csv_file.csv"
Foreach ($group in $groups) {
Add-AzureADMSLifecyclePolicyGroup -Id $policy -groupId $group.objectId}
Reference :
Set Expiry Policy for Specific Groups · GitHub

Related

How to dynamic add users to AccessPackages in AzureAD under entitlement management?

You've got this great new feature in Azure AD under Entitlement management: Access Packages.
Packages including groups and what more for specific users and roles.
https://learn.microsoft.com/en-us/azure/active-directory/governance/entitlement-management-access-package-create
The issue I'm struggling with, is how can I add users by dynamic group without them having to request access first?
I feel like I'm overseeing something, but as it looks now you can only add a Dynamic Group & the users in the group can request access to the AccessPackages.
Has anyone else dealt with this already?
Please check the references and if below can be worked around in your case.
According to Create a new access package in entitlement management - Azure AD | Microsoft Docs.
If you want to bypass access requests and allow administrators to directly assign specific users to this access package. click None (administrator direct assignments only) in request section to create a policy where users need not request for access. For this group selection is not there.Users won't have to request the access package.
But if you need to select specific dynamic group for policy .
You can create a access package with dynamic groups selected .
You can create a policy separately for the users for dynamic group with require approval disabled and requests disabled.
Then while assignment requests are bypassed and approved even if the policy has request approval.
Even if require approval and requests are enabled in first step, you can set a separate policy by setting the by pass approval to yes.
Note :Dynamic group is to be given the owner role for access packages.
Reference: active-directory-entitlement-management-request-policy | (github)

Guest added to Microsoft 365 group through Azure Active Directory PowerShell for Graph module is not able to see Team site

Quick explanation:
We want to add new guests to a Microsoft Team as streamlined as possible. Adding the guest to the M365 group through Powershell seems to work and the guest appears in Team membership, but no URL sent to the guest will get them into the Team channels. They get either an empty Team dashboard (no channels) or "You'll need permissions to access this team or channel", depending on the URL. Deleting the guest from the team and re-adding them through Team admin portal works fine.
Steps to recreate:
Have a team already set up and working, e.g. "MSTeamTest".
Create a CSV in c:\temp called invitations.csv, with the following rows (e.g.):
Name,InvitedUserEmailAddress,TeamName
Test Person, testperson#gmail.com, MSTeamTest
Run these commands in PowerShell (gist):
# Install AzureADPreview
Install-Module AzureADPreview
# Hit UI login for AAD global admin:
Connect-AzureAD
# import CSV
$invitations = import-csv c:\temp\invitations.csv
# Add guest users to AzureAD
$messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo
$messageInfo.customizedMessageBody = "Hey there! Check this out. I created an invitation through PowerShell"
foreach ($email in $invitations) {New-AzureADMSInvitation -InvitedUserEmailAddress $email.InvitedUserEmailAddress -InvitedUserDisplayName $email.Name -InviteRedirectUrl https://teams.microsoft.com/?tenantid={putIDHere} -InvitedUserMessageInfo $messageInfo -SendInvitationMessage $true}
# Add same guest users to Microsoft 365 Group (same csv)
# wait a few seconds so the new guest user objects are available to add to the group
Start-Sleep -Second 30
foreach ($email in $invitations) {Add-AzureADGroupMember -RefObjectId (Get-AzureADUser | Where { $_.Mail -eq $email.InvitedUserEmailAddress }).ObjectID -ObjectId (Get-AzureADGroup | Where { $_.DisplayName -eq $email.TeamName }).ObjectID}
At this point, assuming this was an entirely new guest, you have rights, licenses, etc., you now have the guest in AzureAD and the guest appears in the Team under: https://admin.teams.microsoft.com/teams/manage/{Teamid}
However, if the person tries to use the web version for https://teams.microsoft.com/?tenantid={putIDHere} they get an empty Teams dashboard (no teams listed).
If you send them a Team link from more>get link to team, and they try something like this: https://teams.microsoft.com/l/team/19%{teamID}%40thread.tacv2/conversations?groupId={groupID}&tenantId={tenantID} they get:
"You'll need permissions to access this team or channel. Try contacting the team owner or admin."
And the same behavior happens if they follow a link like this: https://myapps.microsoft.com/?tenantid={tenantID} - they see they are a member of the "MSTeamTest" group with no apps. Clicking the group lets them launch Teams, but they get the same "You'll need permissions" dialog.
And again - through the admin panel, the person looks to be part of membership. For an existing member they see the person listed as a guest on the Team. It's almost like I'm missing one powershell command.
Why am I doing this at all?
The process is too cluttered if the end goal is to just get a guest up and running in Teams. Two emails with manual intervention in between is confusing to the guests (one for AAD, one for Teams)
AzureAD B2B lets you create a guest and make them a member of a group at the same time, but for bulk import in the UI with a CSV of new guest users, it does not let you add membership to a group (aka the Team in question), so I've turned to PowerShell.
I know folks say it takes a while for things to propagate:
https://techcommunity.microsoft.com/t5/microsoft-teams/teams-membership-and-groups-membership/m-p/92982
however this does not seem to be the issue.
If you have any thoughts or a solution I'd be grateful! Thanks!
FYI, please be aware that when you add users to a o365 group through powershell or teams, it can take up to 24 hours to sync with teams backend and to fully provision the users. they are actually 2 separate datasets, where the o365 membership needs to be synced to the teams data on the microsoft backend. so there are chances where you will see inconsistencies up to 24 hours. it's not a real-time operation.
The issues have been made worse with all the covid- work from home situation because teams is seeing such a massive spike of users.
But if you notice inconsistencies, that is usually the reason, especially if you added users through powershell or even more so through graph api.
The order of operation that seems to work seems to be:
Add the user to the AzureAD using: New-AzureADMSInvitation
Wait (e.g.) 30 seconds: Start-Sleep -Second 30
Add user to Microsoft 365 group using: Add-TeamUser
Notes:
Step #3 is part of Install-Module -Name MicrosoftTeams. Email for the Team seems to be sent ~10-15 minutes after the initial invite. The Microsoft Team email has a SharePoint link, and if you go into the documents there, you will eventually see a link to open the Team channel. So far this seems to be working, albeit with the delays mentioned.

LDAP filter to exclude admins group from GAL (on Zimbra)

I'm trying to set up an external active directory GAL on zimbra 8.8.7; My current working filter is
(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
autocomplete filter is
(|(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*))
LDAP search base
dc=sub,dc=domain,dc=com
search and autocomplete returns all AD users, including admin accounts. What is a correct way to exclude administrators group from ldap search?
the accounts I need to exclude are in OU "Admins" and are members of couple of groups like Buildin "Administrators" and users "Domain Admins", "Enterprise admins", etc
I've tried adding (&(objectCategory=group)(!cn=Admin) but it doesn't seem to be valid.
Decided to post my workaround that is already in production. Couldn't make exclusion rule to work and another task required the real employees group to be created on AD anyway, so ended up adding all people accounts to group Staff and domain GAL search looks like this:
LDAP filter: (&(objectCategory=Person)(sAMAccountName=*)(memberOf=cn=Staff,ou=Groups,dc=dc1,dc=domainname,dc=com))
Autocomplete filter: (|(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*))
LDAP search base: dc=dc1,dc=domainname,dc=com

SonarQube updating Active Directory users - sonar.security.updateUserAttributes

In our SonarQube 5.4 we authenticate in Active Directory using LDAP plugin and specifying just one property in sonar.properties:
sonar.security.realm=LDAP
(according to http://docs.sonarqube.org/display/PLUG/Microsoft+Active+Directory)
It's a shame they removed the feature to disable updating user properties on every login:
sonar.security.updateUserAttributes = false
See this:
https://jira.sonarsource.com/browse/SONAR-7219
We've been using it, as update on every login removes assignment of users to SonarQube built-in groups, e.g. sonar-administrators.
I can give individual users whatever rights in Administration > Security > Global Permissions, but I'd prefer to do this for SonarQube groups, as we have lots of users.
Reflecting the whole setup of groups in AD is difficult, as our Infrastructure teams are too slow and bureaucratic
Is there any other way to achieve what we want?
UPDATE
I've tried configuring empty values for group properties:
ldap.group.baseDn=
ldap.group.request=
ldap.group.idAttribute=
But it doesn't help - every login group membership is resynchronized again from AD and membership in internal SQ groups is removed.
In order to disable group synchronisation from LDAP, you can simply remove properties ldap.group.*.
See "Group Mapping" http://docs.sonarqube.org/display/PLUG/LDAP+Plugin.
link to post

Active Directory (LDAP) query or filter to get users with closed mailboxes?

I use Exchange 2003 and I have been searching a lot and found related queries like
(&(UserAccountControl:1.2.840.113556.1.4.803:=2)(msExchHomeServerName=*)(objectClass=User))
Which enumerates disabled user accounts with mailboxes, but what I want is quite the opposite, user accounts (enabled or disabled) with CLOSED mailboxes. Thanks beforehand for any help!
Exchange and Active Directory are separate, if user is created on AD doesn’t mean that it will have mailbox account too but usually both are used together.
You can use any LDAP browser like JXplorer or LDAPadmin to check the settings for your users on Active Directory. You will find disabled users on AD moved to different OU or there should be some attribute which will differentiate it from active users.
You can export LDIF file (by LDAP browser like LDAPadmin) for one active user and one disabled user and compare both to find relevant attribute for disabled entity and use it for your query filter. You can consult your IT team also who is managing Active directory for more details. HTH :)

Resources