Apr 27 2020 08:13 AM
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!
Apr 27 2020 11:36 AM
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.
Apr 27 2020 11:42 AM
Or, try this command to connect to PowerShell instead;
Import-Module SkypeOnlineConnector $Cred = Get-Credential $Session = New-CSOnlineSession -credential $Cred -OverrideAdminDomain “tenantname.onmicrosoft.com”
Apr 28 2020 01:05 AM
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?
Apr 28 2020 02:27 AM
Try adding this command in;
Import-PSSession $session -AllowClobber -Verbose
Then run Get-CsOnlineUser cmd again.
Apr 28 2020 03:17 AM - edited Apr 28 2020 03:23 AM
Thanks again @PeterRising
This worked although Im getting asked to type these details in
:
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
Apr 28 2020 03:41 AM
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
Apr 28 2020 04:03 AM
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
Apr 28 2020 04:12 AM
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)?
Apr 28 2020 04:17 AM
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
Apr 28 2020 04:28 AM
OK, take a look at this. Seems to match the error you are seeing.
Apr 28 2020 04:35 AM
Actually, that relates to Exchange Online as opposed to SFB, but it's worth trying. I'll keep digging.
Apr 28 2020 04:55 AM
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.
Apr 28 2020 05:29 AM - edited Apr 28 2020 05:31 AM
@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 ?
Apr 28 2020 06:14 AM
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
Apr 28 2020 06:34 AM
Hi @PeterRising
Thanks again, this seems to work although weirdly after doing one command it fails and starts asking for this again?
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?
Apr 28 2020 06:41 AM
Yes that is correct, as shown in my example below where i have one user to whom the policy applies;
That is a messaging policy.
Apr 28 2020 06:44 AM - edited Apr 28 2020 06:47 AM
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
Apr 28 2020 06:54 AM
Apr 28 2020 07:08 AM