SOLVED

New-CsTeamsShiftsPolicy cmdlet does not exist using Teams powershell module version 1.1.6

%3CLINGO-SUB%20id%3D%22lingo-sub-1925138%22%20slang%3D%22en-US%22%3ENew-CsTeamsShiftsPolicy%20cmdlet%20does%20not%20exist%20using%20Teams%20powershell%20module%20version%201.1.6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1925138%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20how%20to%20get%20the%20CsTeamsShifts%20cmdlets%20to%20work%20with%20Teams%20powershell%3F%3C%2FP%3E%3CP%3EI'm%20trying%20to%20Manage%20shift-based%20access%20for%20Firstline%20Workers%20in%20Teams.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FMicrosoftTeams%2Fexpand-teams-across-your-org%2Fshifts%2Fmanage-shift-based-access-flw%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FMicrosoftTeams%2Fexpand-teams-across-your-org%2Fshifts%2Fmanage-shift-based-access-flw%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20following%20the%20document%20from%20Microsoft%20to%20install%20Teams%20Powershell%20and%20get%20an%20error%20each%20time%3A%20%3CSTRONG%3EThe%20term%20'New-CsTeamsShiftsPolicy'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3Escript%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.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FMicrosoftTeams%2Fteams-powershell-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FMicrosoftTeams%2Fteams-powershell-overview%3C%2FA%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20document%20states%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3ESkype%20for%20Business%20PowerShell%20Connector%3C%2FSTRONG%3E%3A%20The%20Skype%20for%20Business%20PowerShell%20connector%20is%20now%20a%20part%20of%20Teams%20PowerShell%20module.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EDenise%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1925138%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%20Shifts%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1925987%22%20slang%3D%22en-US%22%3ERe%3A%20New-CsTeamsShiftsPolicy%20cmdlet%20does%20not%20exist%20using%20Teams%20powershell%20module%20version%201.1.6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1925987%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39314%22%20target%3D%22_blank%22%3E%40Denise%20Child%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20cmdlets%20which%20have%20%3CSTRONG%3ECs%3C%2FSTRONG%3E%20in%20the%20name%20are%20part%20of%20the%20Skype%20for%20Business%20Powershell%20connector.%20Therefor%20you%20first%20need%20to%20setup%20a%20session%20to%20the%20connector.%20Can%20you%20try%20the%20following%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24sfbSession%20%3D%20New-CsOnlineSession%0AImport-PSSession%20%24sfbSession%20-AllowClobber%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EThe%20first%20command%2C%20will%20ask%20you%20to%20authenticate%20and%20the%20second%20command%20will%20import%20the%20session%20with%20all%20the%20cmdlets%20you%20need.%20You%20should%20now%20be%20able%20to%20use%20the%26nbsp%3BNew-CsTeamsShiftsPolicy%20in%20your%20PowerShell%20session.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ERuud%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1926650%22%20slang%3D%22en-US%22%3ERe%3A%20New-CsTeamsShiftsPolicy%20cmdlet%20does%20not%20exist%20using%20Teams%20powershell%20module%20version%201.1.6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1926650%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F119954%22%20target%3D%22_blank%22%3E%40Ruud%20Gijsbers%3C%2FA%3E%26nbsp%3B%20Thank%20you!%20That%20worked.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThese%20two%20commands%20allowed%20me%20to%20create%20the%20new%26nbsp%3B%20teams%20shifts%20policy.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-MicrosoftTeams%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24sfbSession%20%3D%20New-CsOnlineSession%3CBR%20%2F%3EImport-PSSession%20%24sfbSession%20-AllowClobber%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hello,

Does anyone know how to get the CsTeamsShifts cmdlets to work with Teams powershell?

I'm trying to Manage shift-based access for Firstline Workers in Teams.

https://docs.microsoft.com/en-us/MicrosoftTeams/expand-teams-across-your-org/shifts/manage-shift-bas...

 

 

I am following the document from Microsoft to install Teams Powershell and get an error each time: The term 'New-CsTeamsShiftsPolicy' 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.

 

https://docs.microsoft.com/en-us/MicrosoftTeams/teams-powershell-overview

 

The document states:

Skype for Business PowerShell Connector: The Skype for Business PowerShell connector is now a part of Teams PowerShell module.

 

Thanks,

Denise

2 Replies
best response confirmed by Denise Child (Contributor)
Solution

Hi @Denise Child,

 

The cmdlets which have Cs in the name are part of the Skype for Business Powershell connector. Therefor you first need to setup a session to the connector. Can you try the following

$sfbSession = New-CsOnlineSession
Import-PSSession $sfbSession -AllowClobber

The first command, will ask you to authenticate and the second command will import the session with all the cmdlets you need. You should now be able to use the New-CsTeamsShiftsPolicy in your PowerShell session.

 

Regards,

Ruud

@RuudGijsbers  Thank you! That worked.

 

These two commands allowed me to create the new  teams shifts policy.

 

Connect-MicrosoftTeams

 

$sfbSession = New-CsOnlineSession
Import-PSSession $sfbSession -AllowClobber