SOLVED

Move some users to "Teams Only" mode with powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-848814%22%20slang%3D%22en-US%22%3EMove%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-848814%22%20slang%3D%22en-US%22%3EDoes%20anyone%20have%20a%20script%20that%20will%20move%20users%20in%20bulk%20from%20islands%20mode%20to%20ms%20teams%20only%20please%3F%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-848814%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-848842%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-848842%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20a%20simple%20script%20that%20reads%20sip%20address%20from%20a%20csv%20file%20and%20change%20mode.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24Users%20%3D%20Import-Csv%20-Path%20c%3A%5Ctemp%5Cusers.csv%0A%0Aforeach(%24User%20in%20%24Users)%0A%7B%0A%0AGrant-CsTeamsUpgradePolicy%20-Identity%20%24User.SipAddress%20-PolicyName%20UpgradeToTeams%0A%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20change%20for%20all%20users%20in%20your%20organisation%20you%20can%20change%20the%20default%20mode%20instead.%20Teams%20Admin%20Center%20%26gt%3B%20Org-wide%20Settings%20%26gt%3B%20Teams%20Upgrade%2C%20change%20Coexistence%20mode%20to%20Teams%20only.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F131155i43B8F097AC444F95%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-848937%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-848937%22%20slang%3D%22en-US%22%3ELinus%20will%20this%20work%20if%20i%20have%20a%20current%20csv%20with%20a%20column%20titled%3A%20UserPrincipalName%20username%40company.com%20%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-849116%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-849116%22%20slang%3D%22en-US%22%3EI%20get%20this%20error%3A%20%24Users%20%3D%20Import-Csv%20-Path%20c%3A%5Ctemp%5CTeamsOnlyMode.csv%20foreach(%24User%20in%20%24Users)%20%7B%20Grant-CsTeamsUpgradePolicy%20-Identity%20%24User.SipAddress%20-PolicyName%20UpgradeToTeams%20%7D%20Grant-CsTeamsUpgradePolicy%20%3A%20The%20term%20'Grant-CsTeamsUpgradePolicy'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%20again.%20At%20line%3A6%20char%3A1%20%2B%20Grant-CsTeamsUpgradePolicy%20-Identity%20%24User.SipAddress%20-PolicyName%20Upg%20...%20%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~%20%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(Grant-CsTeamsUpgradePolicy%3AString)%20%5B%5D%2C%20CommandNotFoundException%20%2B%20FullyQualifiedErrorId%20%3A%20CommandNotFoundException%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-849242%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-849242%22%20slang%3D%22en-US%22%3EFigured%20it%20out%20Linus%2C%20but%20what%20if%20i%20want%20to%20notify%20the%20Skype%20for%20Business%20user%3F%20%23Connect%20using%20a%20Skype%20for%20Business%20Online%20administrator%20account%20with%20multifactor%20authentication%20Import-Module%20SkypeOnlineConnector%20%24sfbSession%20%3D%20New-CsOnlineSession%20Import-PSSession%20%24sfbSession%20%24Users%20%3D%20Import-Csv%20-Path%20c%3A%5Ctemp%5CTeamsOnlyMode.csv%20foreach(%24User%20in%20%24Users)%20%7B%20Grant-CsTeamsUpgradePolicy%20-Identity%20%24User.UserPrincipalName%20-PolicyName%20UpgradeToTeams%20%7D%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-849309%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-849309%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreat%20that%20you%20figured%20it%20out.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can't%20set%20the%20notify%20user%20switch%20when%20switching%20them%20to%20TeamsOnly%2C%20since%20when%20they%20are%20in%20TeamsOnly%20mode%20they%20will%20not%20use%20the%20Skype%20client%20anymore.%20So%20that%20you%20have%20to%20inform%20them%20about%20with%20a%20good%20user%20adoption.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-851578%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-851578%22%20slang%3D%22en-US%22%3EJust%20wondering%20what%20that%20switch%20looks%20like%2C%20do%20you%20happen%20to%20know%20please%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-853432%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-853432%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F66940%22%20target%3D%22_blank%22%3E%40Chad%20Rodriguez%3C%2FA%3E%26nbsp%3BIt%20is%20not%20a%20separate%20switch%20for%20notifying%20users%20it%20is%20different%20modes.%20So%20for%26nbsp%3B%3CSPAN%3ESfBWithTeamsCollab%20you%20have%26nbsp%3BSfBWithTeamsCollab%20and%26nbsp%3BSfBWithTeamsCollabWithNotify%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EGrant-CsTeamsUpgradePolicy%20-Identity%20%24User.SipAddress%20-PolicyName%20SfBWithTeamsCollabWithNotify%0A%0Aor%0A%0AGrant-CsTeamsUpgradePolicy%20-Identity%20%24User.SipAddress%20-PolicyName%20SfBWithTeamsCollab%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-853434%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-853434%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F66940%22%20target%3D%22_blank%22%3E%40Chad%20Rodriguez%3C%2FA%3E%26nbsp%3BCheck%20this%20article%20too%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fskype%2Fgrant-csteamsupgradepolicy%3Fview%3Dskype-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fskype%2Fgrant-csteamsupgradepolicy%3Fview%3Dskype-ps%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1014985%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1014985%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F66940%22%20target%3D%22_blank%22%3E%40Chad%20Rodriguez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecould%20you%20share%20your%20script%20for%20moving%20users%20to%20teams%20only%20mode..%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1388630%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1388630%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9476%22%20target%3D%22_blank%22%3E%40Linus%20Cansby%3C%2FA%3E%26nbsp%3Bsame%20way%20i%20am%20getting%20error%20i%20want%20to%20know%20from%20which%20machine%20i%20want%20run%20the%20script%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1388668%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1388668%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9476%22%20target%3D%22_blank%22%3E%40Linus%20Cansby%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecan%20you%20send%20me%20to%20my%20email%20address%20%3CA%20href%3D%22mailto%3Aramece1987%40gmail.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eramece1987%40gmail.com%3C%2FA%3E%26nbsp%3Bfor%20the%20further%20explaination%26nbsp%3B%20i%20want%20to%20complete%20the%20100%20user%20to%20activat%20teams%20useing%20powershell%20script%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1390473%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1390473%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F666186%22%20target%3D%22_blank%22%3E%40Ram_vignesh1987%3C%2FA%3E%26nbsp%3BIf%20you%20are%20moving%20from%20Skype%20for%20Business%20Online%20to%20Teams%20you%20can%20run%20it%20from%20any%20machine%2C%20just%20connect%20to%20Skype%20for%20Business%20Online%20Powershell.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1392316%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1392316%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9476%22%20target%3D%22_blank%22%3E%40Linus%20Cansby%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20we%20first%20connect%20o365%20in%20powershell%20then%20run%20the%20script%20in%20the%20powershell%20even%20i%20am%20not%20able%20to%20find%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1392608%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1392608%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9476%22%20target%3D%22_blank%22%3E%40Linus%20Cansby%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5CUsers%5CRam_Vignesh%26gt%3B%20cd%20c%3A%5C%3CBR%20%2F%3EPS%20C%3A%5C%26gt%3B%20%24Users%20%3D%20Import-Csv%20-Path%20c%3A%5Cusers.csv%3CBR%20%2F%3EPS%20C%3A%5C%26gt%3B%20foreach(%24User%20in%20%24Users)%3CBR%20%2F%3E%26gt%3B%26gt%3B%20%7B%20Grant-CsTeamsUpgradePolicy%20-Identity%20%24User.%20UserPrincipalName%20-PolicyName%20UpgradeToTeams%20%7D%3CBR%20%2F%3EGrant-CsTeamsUpgradePolicy%20%3A%20The%20term%20'Grant-CsTeamsUpgradePolicy'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%3CBR%20%2F%3Efunction%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%3CBR%20%2F%3Epath%20is%20correct%20and%20try%20again.%3CBR%20%2F%3EAt%20line%3A2%20char%3A3%3CBR%20%2F%3E%2B%20%7B%20Grant-CsTeamsUpgradePolicy%20-Identity%20%24User.%20UserPrincipalName%20-Poli%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(Grant-CsTeamsUpgradePolicy%3AString)%20%5B%5D%2C%20CommandNotFoundException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20CommandNotFoundException%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Efacing%20the%20error%20could%20tell%20me%20the%20reason%20for%20the%20error%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1398499%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1398499%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F666186%22%20target%3D%22_blank%22%3E%40Ram_vignesh1987%3C%2FA%3E%26nbsp%3BCheck%20this%20document%20to%20download%20Skype%20for%20Business%20Online%20powershell%20module%20and%20then%20how%20to%20connect%20to%20SfB%20Online%20to%20run%20the%20command.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fenterprise%2Fpowershell%2Fconnect-to-all-office-365-services-in-a-single-windows-powershell-window%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fenterprise%2Fpowershell%2Fconnect-to-all-office-365-services-in-a-single-windows-powershell-window%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1542593%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1542593%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9476%22%20target%3D%22_blank%22%3E%40Linus%20Cansby%3C%2FA%3E%26nbsp%3BWhat%20should%20be%20the%20.csv%20file%20look%20like.%20I%20used%20the%20userpricipalname%20in%20tab%20and%20the%20user%20name%20below%20it%3F%20That%20did%20not%20help%20me.%20Please%20share%20if%20there%20is%20an%20example%20file.%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1543917%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1543917%22%20slang%3D%22en-US%22%3Eforeach(%24User%20in%20%24Users)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EGrant-CsTeamsUpgradePolicy%20-Identity%20%24User.SipAddress%20-PolicyName%20UpgradeToTeams%3CBR%20%2F%3E%7D%3CBR%20%2F%3ECannot%20validate%20argument%20on%20parameter%20'Identity'.%20The%20argument%20is%20null%20or%20empty.%20Provide%20an%20argument%20that%20is%20not%20null%20or%20empty%2C%20and%3CBR%20%2F%3Ethen%20try%20the%20command%20again.%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidData%3A%20(%3A)%20%5BGrant-CsTeamsUpgradePolicy%5D%2C%20ParameterBindingValidationException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20ParameterArgumentValidationError%2CMicrosoft.Rtc.Management.AD.Cmdlets.AssignCSTeamsUpgradePolicyCmdlet%3CBR%20%2F%3E%2B%20PSComputerName%20%3A%20admin3a.online.lync.com%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1545407%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1545407%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F65897%22%20target%3D%22_blank%22%3E%40NARASA%20SARAT%20MEDAPALLI%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHeader%20with%26nbsp%3BSipAddress%20and%20then%20one%20sip%20address%20per%20row%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESipAddress%3CBR%20%2F%3E%3CA%20href%3D%22mailto%3Auser1%40contoso.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Euser1%40contoso.com%3C%2FA%3E%3C%2FP%3E%0A%3CP%3Euser2%40contoso.com%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1545412%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20some%20users%20to%20%22Teams%20Only%22%20mode%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1545412%22%20slang%3D%22en-US%22%3EYup!%20%E2%80%9C%20%24User.SipAddress%E2%80%9D%20means%20selecting%20the%20%E2%80%9Csipaddress%E2%80%9D%20field%20in%20the%20CSV%20for%20every%20user%20the%20scripts%20loops%20through%2C%20so%20in%20this%20case%20header%20must%20be%20sipaddress%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor
Does anyone have a script that will move users in bulk from islands mode to ms teams only please?
19 Replies
Highlighted
Best Response confirmed by Chad Rodriguez (Occasional Contributor)
Solution

This is a simple script that reads sip address from a csv file and change mode.

 

$Users = Import-Csv -Path c:\temp\users.csv

foreach($User in $Users)
{

Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams

}

 

If you want to change for all users in your organisation you can change the default mode instead. Teams Admin Center > Org-wide Settings > Teams Upgrade, change Coexistence mode to Teams only.

clipboard_image_0.png

Highlighted
Linus will this work if i have a current csv with a column titled: UserPrincipalName username@company.com ?
Highlighted
I get this error: $Users = Import-Csv -Path c:\temp\TeamsOnlyMode.csv foreach($User in $Users) { Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams } Grant-CsTeamsUpgradePolicy : The term 'Grant-CsTeamsUpgradePolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:6 char:1 + Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName Upg ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Grant-CsTeamsUpgradePolicy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Highlighted
Figured it out Linus, but what if i want to notify the Skype for Business user? #Connect using a Skype for Business Online administrator account with multifactor authentication Import-Module SkypeOnlineConnector $sfbSession = New-CsOnlineSession Import-PSSession $sfbSession $Users = Import-Csv -Path c:\temp\TeamsOnlyMode.csv foreach($User in $Users) { Grant-CsTeamsUpgradePolicy -Identity $User.UserPrincipalName -PolicyName UpgradeToTeams }
Highlighted

Hi,

 

Great that you figured it out. 

 

You can't set the notify user switch when switching them to TeamsOnly, since when they are in TeamsOnly mode they will not use the Skype client anymore. So that you have to inform them about with a good user adoption. 

Highlighted
Just wondering what that switch looks like, do you happen to know please?
Highlighted

@Chad Rodriguez It is not a separate switch for notifying users it is different modes. So for SfBWithTeamsCollab you have SfBWithTeamsCollab and SfBWithTeamsCollabWithNotify

 

Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName SfBWithTeamsCollabWithNotify

or

Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName SfBWithTeamsCollab

 

Highlighted

@Chad Rodriguez 

 

could you share your script for moving users to teams only mode..

Highlighted

@Linus Cansby same way i am getting error i want to know from which machine i want run the script 

Highlighted

@Linus Cansby 

 

can you send me to my email address ramece1987@gmail.com for the further explaination  i want to complete the 100 user to activat teams useing powershell script 

Highlighted

@Ram_vignesh1987 If you are moving from Skype for Business Online to Teams you can run it from any machine, just connect to Skype for Business Online Powershell.

Highlighted

@Linus Cansby 

Do we first connect o365 in powershell then run the script in the powershell even i am not able to find 

Highlighted

 

@Linus Cansby 

 

PS C:\Users\Ram_Vignesh> cd c:\
PS C:\> $Users = Import-Csv -Path c:\users.csv
PS C:\> foreach($User in $Users)
>> { Grant-CsTeamsUpgradePolicy -Identity $User. UserPrincipalName -PolicyName UpgradeToTeams }
Grant-CsTeamsUpgradePolicy : The term 'Grant-CsTeamsUpgradePolicy' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:2 char:3
+ { Grant-CsTeamsUpgradePolicy -Identity $User. UserPrincipalName -Poli ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Grant-CsTeamsUpgradePolicy:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

 

 

facing the error could tell me the reason for the error 

Highlighted

@Ram_vignesh1987 Check this document to download Skype for Business Online powershell module and then how to connect to SfB Online to run the command.

 

https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-all-office-365-services-...

Highlighted

@Linus Cansby What should be the .csv file look like. I used the userpricipalname in tab and the user name below it? That did not help me. Please share if there is an example file. Thanks

Highlighted
foreach($User in $Users)
{
Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams
}
Cannot validate argument on parameter 'Identity'. The argument is null or empty. Provide an argument that is not null or empty, and
then try the command again.
+ CategoryInfo : InvalidData: (:) [Grant-CsTeamsUpgradePolicy], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Rtc.Management.AD.Cmdlets.AssignCSTeamsUpgradePolicyCmdlet
+ PSComputerName : admin3a.online.lync.com
Highlighted

@NARASA SARAT MEDAPALLI 

Header with SipAddress and then one sip address per row:

 

SipAddress
user1@contoso.com

user2@contoso.com

Highlighted
Yup! “ $User.SipAddress” means selecting the “sipaddress” field in the CSV for every user the scripts loops through, so in this case header must be sipaddress