Importing users into meeting policy

Steel Contributor

Hi all, 

 

Im struggling to import bulk users into a meeting policy, I believe you have to use powershell install module (which iv done) and connect to Skype for business however when I use the following commands: 

 

Import-Module SkypeOnlineConnector
$userCredential = Get-Credential
$sfbSession = New-CsOnlineSession -Credential $userCredential
Import-PSSession $sfbSession

 

I get this error? 

Get-CsOnlinePowerShellEndpoint : There is an error in XML document (3, 2).

At C:\Program Files\Common Files\Skype for Business

Online\Modules\SkypeOnlineConnector\SkypeOnlineConnectorStartup.psm1 

 

PLEASE HELP!

25 Replies

@AB21805 

 

You can do this in bulk via the Teams Admin Center.  How many users are you needing to do this for?  If it's no more than say 20, then the Admin Center is your best bet to update in bulk.

@AB21805 

 

Or, try this command to connect to PowerShell instead;

 

Import-Module SkypeOnlineConnector
$Cred = Get-Credential
$Session = New-CSOnlineSession -credential $Cred -OverrideAdminDomain “tenantname.onmicrosoft.com”

Hi @PeterRising

 

I didn't get any errors so thank you but I seem to not be able to run this to test if Im connected: 

 

Get-CsOnlineUser -Filter {TeamsMessagingPolicy -eq ‘Test'} | Select UserPrincipalName

 

I get the following error: 

Get-CsOnlineUser : The term 'Get-CsOnlineUser' 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.

 

Any Ideas? 

@AB21805 

 

Try adding this command in;

 

Import-PSSession $session -AllowClobber -Verbose

 

Then run Get-CsOnlineUser cmd again.

Thanks again @PeterRising 

 

This worked although Im getting asked to type these details in

Screenshot 2020-04-28 at 11.12.48 AM.png:

 

after entering: 

Get-CsOnlineUser-Filter {TeamsMessagingPolicy -eq 'Test'} | Select UserPrincipalName

 

This then brings up the error: 

 

New-PSSession : [admin1e.online.lync.com] Connecting to remote server

admin1e.online.lync.com failed with the following error message : The WinRM client cannot

process the request. The authentication mechanism requested by the client is not supported

by the server or unencrypted traffic is disabled in the service configuration. Verify the

unencrypted traffic setting in the service configuration or specify one of the

authentication mechanisms supported by the server.  To use Kerberos, specify the computer

name as the remote destination. Also verify that the client computer and the destination

computer are joined to a domain. To use Basic, specify the computer name as the remote

destination, specify Basic authentication and provide user name and password. Possible

authentication mechanisms reported by server: For more information, see the

about_Remote_Troubleshooting Help topic.

 

I am a global admin and I typed in the same details that worked at the start when I used

Import-Module SkypeOnlineConnector

$Cred = Get-Credential

$Session = New-CSOnlineSession -credential $Cred -OverrideAdminDomain "mytenant.onmicrosoft.com"

 

Why would this be? 

 

Thanks again for your continuous help 

@AB21805 

 

You have the command as 

 

Get-CsOnlineUser-Filter {TeamsMessagingPolicy -eq 'Test'} | Select UserPrincipalName

 

There needs to be a space after Get-CSOnlineUser as below;

 

Get-CsOnlineUser -Filter {TeamsMessagingPolicy -eq 'Test'} | Select UserPrincipalName

 

Hi @PeterRising 

 

Sorry that was a mistype I was actually typing Get-CsOnlineUser -Filter {TeamsMessagingPolicy -eq 'Test'} | Select UserPrincipalName

 

Stilll getting the error in the previous reply

 

Please help

@AB21805 

 

Does your Global Admin account have MFA applied to it?  If so, can you try with a GA account without MFA (not ideal I know but MFA and PowerShell often don't play nice together)?

Hi @PeterRising 

 

My account currently doesn't have MFA on and still no luck! 

 

Is it something to do with?  

-OverrideAdminDomain? 

 

Why is this something I need to use? 

 

Is there another way / formula that I can get over 20 users into a teams policy? 

 

Thanks again

 

@AB21805 

 

Actually, that relates to Exchange Online as opposed to SFB, but it's worth trying.  I'll keep digging.

 

 

@AB21805 

 

OK, try this

 

Connect to PowerShell as Administrator

 

Enter the following;

 

Import-Module SkypeOnlineConnector

$userCredential = Get-Credential

$sfbSession = New-CsOnlineSession -Credential $userCredential

Import-PSSession $sfbSession -AllowClobber -Verbose

 

Enter GA creds when prompted, then type;

 

Get-CsOnlineUser -Filter {TeamsMessagingPolicy -eq 'Test'} | Select UserPrincipalName

 

This works for me.

 

 

 

 

 

 

 

@PeterRising I seem to get this error again:

Get-CsOnlinePowerShellEndpoint : There is an error in XML document (3, 2).

At C:\Program Files\Common Files\Skype for Business

Online\Modules\SkypeOnlineConnector\SkypeOnlineConnectorStartup.psm1:149 char:26

+ ... targetUri = Get-CsOnlinePowerShellEndpoint -TargetDomain $adminDomain ...

 

 

As we are connecting to teams why do we have to go though skype for business to import users into a teams policy. 

 

Would it because I need a teams module installed ? 

 

@AB21805 

 

No, we are in the correct module, strange as it seems.  

 

So, I know we are going round in circles a bit now, but just to double check with you that the following also does not work (which does work for me);

 

Import-Module SkypeOnlineConnector

$Cred = Get-Credential

$Session = New-CSOnlineSession -credential $Cred -OverrideAdminDomain “tenantname.onmicrosoft.com”

 

Import-PSSession $Session -AllowClobber -Verbose

 

Get-CsOnlineUser -Filter {TeamsMessagingPolicy -eq 'Test'} | Select UserPrincipalName

Hi @PeterRising 

 

Thanks again, this seems to work although weirdly after doing one command it fails and starts asking for this again? 

Screenshot 2020-04-28 at 11.12.48 AM.png

 

I want to test with another command so I want to use this 

Get-CsOnlineUser -Filter {TeamsMeeetingsPolicy -eq 'Test'} | Select UserPrincipalName

 

Would this be the correct formula to see what users i have in the meeting test? 

@AB21805 

 

Yes that is correct, as shown in my example below where i have one user to whom the policy applies;

 

cap2.PNG

 

That is a messaging policy.

Hi @PeterRising 

 

What would be the formula for a Meetings policy rather than a messaging policy? 

 

add if I wanted to import the bulk users into a Meetings policy, how so I go by doing so? Can you help with this please

 

I appreciate the consistent support thank you

@AB21805 

 

Same principal, as below;

 

cap3.PNG

Let me see if I can put together some instructions for you.

thanks you@PeterRising 

 

That would be much appreciated !