SOLVED
Home

Auto-Add new employees

%3CLINGO-SUB%20id%3D%22lingo-sub-204640%22%20slang%3D%22en-US%22%3EAuto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204640%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20add%20new%20members%20to%20a%20team%20automatically%3F%3C%2FP%3E%3CP%3EWe%20have%20a%20team%20called%20%22general%22.%20In%20this%20channel%20there%20should%20be%20all%20of%20our%20employees.%3CBR%20%2F%3ELet%C2%B4s%20say%20our%20company%20gets%202%20new%20employees.%20Both%20of%20them%20will%20be%20in%20the%20active%20directory%20group%20%22employees%22.%20Is%20it%20possible%20that%20they%20will%20be%20automatically%20added%20to%20the%20team%20%22general%22%3F%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EKind%20Regards%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EMathias%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-204640%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHow-to%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320223%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320223%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20info.%3CBR%20%2F%3E%22.%20If%20your%20environment%20has%20100%20users%20or%20less%20you%20can%20request%20a%20free%20subscription%20license%20for%20our%20commercial%20tools%20so%20you%20can%20use%20all%20of%20the%20features%20at%20no%20charge%22%3CBR%20%2F%3EIt's%20new%20price%20table.%20%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.cayosoft.com%2Ffree-office-365-tools%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.cayosoft.com%2Ffree-office-365-tools%2F%3C%2FA%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320130%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320130%22%20slang%3D%22en-US%22%3E%3CP%3ELooks%20like%20Cayosoft%20has%20recently%20(Dec%202018)%20eliminated%20their%20%26lt%3B200%20users-for-free%20option%20-%20their%20tool%20does%20a%20great%20job%20for%20Teams%2C%20AD%20and%20exchange%20mgmt%20without%20Powershell%2C%20but%20pricing%20more%20realistic%20for%20the%20500%2B%20companies.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-295245%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-295245%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20noted%20earlier%2C%20org-wide%20teams%20are%20now%20available%20if%20your%20tenant%20is%20under%201%2C000%20users.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Foffice365itpros.com%2F2018%2F10%2F10%2Forg-wide-teams-now-available%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Foffice365itpros.com%2F2018%2F10%2F10%2Forg-wide-teams-now-available%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20not%2C%20you'll%20still%20have%20to%20think%20about%20another%20method%20to%20add%20new%20users%20to%20a%20team%20automatically%2C%20subject%20to%20the%20limit%20for%20a%20team%20(currently%202%2C500%20members).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-295060%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-295060%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F156199%22%20target%3D%22_blank%22%3E%40Mathias%20Koprek%3C%2FA%3E%2C%20have%20you%26nbsp%3Bseen%20the%20new%20%22Org-wide%20Teams%22%20settings%20yet%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fcreate-an-org-wide-team%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fcreate-an-org-wide-team%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-268406%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-268406%22%20slang%3D%22en-US%22%3EWhen%20you%20are%20under%20200%20objects%2C%20try%20to%20using%20%22Cayosoft%22%20for%20free.%20There%20is%20an%20dynamic%20group%20options.%20And%20you%20don't%20need%20deep%20dive%20experience%20in%20powershell.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-207983%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207983%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.petri.com%2Fteams-powershell-primer%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.petri.com%2Fteams-powershell-primer%3C%2FA%3E%20will%20give%20you%20plenty%20of%20tips%20about%20how%20to%20use%20the%20Teams%20PowerShell%20module.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EEvery%20mailbox%20has%2015%20customizable%20attributes%20that%20you%20can%20use%20for%20your%20own%20purposes.%20Here's%20how%20to%20update%20a%20mailbox%20using%20CustomAttribute1%20with%20a%20value%20that%20you%20can%20later%20check.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ESet-Mailbox%20-Id%20Someone%20-CustomAttribute%20%22Y%22%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20find%20all%20mailboxes%20that%20do%20not%20have%20the%20attribute%20set%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%24Mbx%20%3D%20(%3CSPAN%3EGet-Mailbox%20-Filter%20%7BCustomAttribute1%20-ne%20%22Y%22%7D)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENow%20process%20each%20mailbox%20and%20add%20them%20to%20the%20Office%20365%20Group%20(you%20could%20also%20use%20Add-TeamUser%20but%20this%20is%20easier%20because%20it%20saves%20loading%20a%20module).%20Then%20also%20update%20the%20mailbox%20so%20we%20don't%20process%20it%20again.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EForEach%20(%24M%20in%20%24Mbx)%20%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20Add-UnifiedGroupLinks%20-Id%20MyGroup%20-LinkType%20Members%20-Links%20%24M.Alias%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20Set-Mailbox%20-Id%20%24M.Alias%20-CustomAttribute1%20%22Y%22%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20you're%20getting%20into%20this%20kind%20of%20stuff%2C%20perhaps%20you%20should%20buy%20a%20good%20book%20that%20discusses%20how%20to%20use%20PowerShell%20with%20Groups%20and%20Teams.%20Like%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgum.co%2FO365IT%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20for%20IT%20Pros%3C%2FA%3E%20(which%20I%20am%20involved%20in).%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-207917%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207917%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20kinda%20new%20to%20PowerShell.%3C%2FP%3E%3CP%3EDo%20you%20have%20an%20example%20code%20or%20script%20for%20me%3F%20It%20would%20be%20easier%20for%20me%20to%20understand%20what%20exactly%20I%20need%20to%20do.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-207911%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207911%22%20slang%3D%22en-US%22%3EI%20will%20give%20this%20a%20try!%3CBR%20%2F%3EThanks%20a%20lot!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-205685%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-205685%22%20slang%3D%22en-US%22%3E%3CP%3EDynamic%20groups%20are%20the%20easy%20way%20to%20do%20this%2C%20but%20if%20you%20don't%20want%20to%20pay%20for%20the%20Azure%20AD%20P1%20premium%20licenses%2C%20it's%20easy%20to%20script%20a%20solution%20with%20PowerShell.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Look%20for%20all%20new%20mailboxes%20(use%20a%20custom%20attribute%20to%20indicate%20whether%20the%20user%20is%20processed).%3C%2FP%3E%0A%3CP%3E2.%20Call%20Add-TeamUser%2C%20Add-UnifiedGroupLinks%2C%20or%20Add-AzureADGroupMember%20to%20update%20the%20group%2Fteam%20with%20the%20new%20members.%3C%2FP%3E%0A%3CP%3E3.%20Update%20the%20mailboxes%20to%20show%20that%20the%20users%20have%20been%20processed.%3C%2FP%3E%0A%3CP%3E4.%20Stir%20and%20repeat%20daily.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204839%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204839%22%20slang%3D%22en-US%22%3EIt%20requires%20Azure%20AD%20Premium%20licenses%20to%20do%20dynamic%20membership.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204647%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204647%22%20slang%3D%22en-US%22%3E%3CP%3EOkay%20thanks.%20I%20wanted%20to%20try%20this%20out%20now.%20Unfortunately%20I%20don%C2%B4t%20get%20the%20membership%20type%20%22Dynamic%20User%22%20or%20the%20%22Dynamic%20membership%20rules%22%20that%20are%20described%20in%20your%20first%20link.%3CBR%20%2F%3EAm%20I%20doing%20something%20wrong%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204645%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204645%22%20slang%3D%22en-US%22%3E%3CP%3EThen%20You%20have%20to%20use%20Writeback.%20(Takes%20a%20little%20planning%20before%20you%20do%20that%20though...)%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fconnect%2Factive-directory-aadconnect-feature-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fconnect%2Factive-directory-aadconnect-feature-preview%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204644%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204644%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20I%20will%20try%20this.%3C%2FP%3E%3CP%3EIf%20I%20create%20a%20new%20group%20in%20the%20Azure%20AD%20will%20it%20be%20created%20in%20our%20Active%20Directory%20aswell%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204643%22%20slang%3D%22en-US%22%3ERe%3A%20Auto-Add%20new%20employees%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204643%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Mathias!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%20You%20can%20achieve%20this%20by%20making%20the%20teams%20Azure%20AD-group%20dynamic%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Factive-directory-groups-dynamic-membership-azure-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Factive-directory-groups-dynamic-membership-azure-portal%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Mathias Koprek
Occasional Contributor

Hi,

 

Is it possible to add new members to a team automatically?

We have a team called "general". In this channel there should be all of our employees.
Let´s say our company gets 2 new employees. Both of them will be in the active directory group "employees". Is it possible that they will be automatically added to the team "general"?


Kind Regards


Mathias

14 Replies

Hi Mathias!

 

Yes You can achieve this by making the teams Azure AD-group dynamic: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-groups-dynamic-membership-a...

Thanks I will try this.

If I create a new group in the Azure AD will it be created in our Active Directory aswell?

 

Then You have to use Writeback. (Takes a little planning before you do that though...) 

https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnect-feature-...

 

Okay thanks. I wanted to try this out now. Unfortunately I don´t get the membership type "Dynamic User" or the "Dynamic membership rules" that are described in your first link.
Am I doing something wrong?

It requires Azure AD Premium licenses to do dynamic membership.
Solution

Dynamic groups are the easy way to do this, but if you don't want to pay for the Azure AD P1 premium licenses, it's easy to script a solution with PowerShell.

 

1. Look for all new mailboxes (use a custom attribute to indicate whether the user is processed).

2. Call Add-TeamUser, Add-UnifiedGroupLinks, or Add-AzureADGroupMember to update the group/team with the new members.

3. Update the mailboxes to show that the users have been processed.

4. Stir and repeat daily.

 

 

Highlighted
I will give this a try!
Thanks a lot!

I am kinda new to PowerShell.

Do you have an example code or script for me? It would be easier for me to understand what exactly I need to do.

https://www.petri.com/teams-powershell-primer will give you plenty of tips about how to use the Teams PowerShell module.

 

Every mailbox has 15 customizable attributes that you can use for your own purposes. Here's how to update a mailbox using CustomAttribute1 with a value that you can later check.

 

Set-Mailbox -Id Someone -CustomAttribute "Y"

 

To find all mailboxes that do not have the attribute set:

 

$Mbx = (Get-Mailbox -Filter {CustomAttribute1 -ne "Y"})

 

Now process each mailbox and add them to the Office 365 Group (you could also use Add-TeamUser but this is easier because it saves loading a module). Then also update the mailbox so we don't process it again.

 

ForEach ($M in $Mbx) {

   Add-UnifiedGroupLinks -Id MyGroup -LinkType Members -Links $M.Alias

   Set-Mailbox -Id $M.Alias -CustomAttribute1 "Y"

}

 

If you're getting into this kind of stuff, perhaps you should buy a good book that discusses how to use PowerShell with Groups and Teams. Like Office 365 for IT Pros (which I am involved in).

When you are under 200 objects, try to using "Cayosoft" for free. There is an dynamic group options. And you don't need deep dive experience in powershell.

Hi @Mathias Koprek, have you seen the new "Org-wide Teams" settings yet?

https://docs.microsoft.com/en-us/microsoftteams/create-an-org-wide-team

 

As noted earlier, org-wide teams are now available if your tenant is under 1,000 users. https://office365itpros.com/2018/10/10/org-wide-teams-now-available/

 

If not, you'll still have to think about another method to add new users to a team automatically, subject to the limit for a team (currently 2,500 members).

Looks like Cayosoft has recently (Dec 2018) eliminated their <200 users-for-free option - their tool does a great job for Teams, AD and exchange mgmt without Powershell, but pricing more realistic for the 500+ companies.

Thanks for the info.
". If your environment has 100 users or less you can request a free subscription license for our commercial tools so you can use all of the features at no charge"
It's new price table.
https://www.cayosoft.com/free-office-365-tools/