DocumentConfigMgrCB icon indicating copy to clipboard operation
DocumentConfigMgrCB copied to clipboard

Error in function Get-PWCMCoMgmtAdminCenterDeviceUploadStatus

Open NorbertBauer opened this issue 2 years ago • 10 comments

I always get an error from the command in line 2972:

Invoke-CimMethod : The WS-Management service cannot process the request because it contains an invalid character. WS-Management cannot convert the string to a number. String: true. Ensure that the string represents the correct datatype. At D:\Tools\DocumentConfigMgrCB-master\DocumentCMCB.ps1:2972 char:34

  • ... onMapping = Invoke-CimMethod -Namespace "ROOT\SMS\site_$SiteCode" -Ci ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ProtocolError: (ROOT\SMS\site_xxx:SMS_CoMgmtConfigs:String) [Invoke-CimMethod], CimExcep tion
    • FullyQualifiedErrorId : HRESULT 0x80338041,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand
    • PSComputerName : SiteServer.domain.yyy

NorbertBauer avatar Feb 23 '23 09:02 NorbertBauer

@NorbertBauer, is your SiteCode a number like 001? If so, try quoting it in the command line parameter to force it to be typed as a string.

ChadSimmons avatar Feb 23 '23 17:02 ChadSimmons

No, the SiteCode is like "AB1"

NorbertBauer avatar Feb 23 '23 18:02 NorbertBauer

It looks like you can get that same error if you do not have the AAD Tenant ID defined in CM. So, perhaps something missing in the co-management configuration in your site? Hard to say. I don't have access to a fully configured CM environment anymore. Job has changed and I don't spend much time with it anymore, so it's all a bit fuzzy.

paulwetter avatar Feb 25 '23 00:02 paulwetter

When I run the commands in this function one by one, then I can get the AAD tenant ID but this command also fails, even if I can see all variables have correct values.

Gesendet von Outlook für iOShttps://aka.ms/o0ukef


Von: Paul Wetter @.> Gesendet: Saturday, February 25, 2023 1:51:18 AM An: paulwetter/DocumentConfigMgrCB @.> Cc: NorbertBauer @.>; Mention @.> Betreff: Re: [paulwetter/DocumentConfigMgrCB] Error in function Get-PWCMCoMgmtAdminCenterDeviceUploadStatus (Issue #103)

It looks like you can get that same error if you do not have the AAD Tenant ID defined in CM. So, perhaps something missing in the co-management configuration in your site? Hard to say. I don't have access to a fully configured CM environment anymore. Job has changed and I don't spend much time with it anymore, so it's all a bit fuzzy.

— Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/103#issuecomment-1444826179, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOR7FPK6JGOSVM4INB4KQ3WZFJQNANCNFSM6AAAAAAVFM4SWI. You are receiving this because you were mentioned.Message ID: @.***>

NorbertBauer avatar Feb 25 '23 07:02 NorbertBauer

Anyway, maybe I can spend some time in different customer environments to test, check and maybe find a solution for this one.

Gesendet von Outlook für iOShttps://aka.ms/o0ukef


Von: Paul Wetter @.> Gesendet: Saturday, February 25, 2023 1:51:18 AM An: paulwetter/DocumentConfigMgrCB @.> Cc: NorbertBauer @.>; Mention @.> Betreff: Re: [paulwetter/DocumentConfigMgrCB] Error in function Get-PWCMCoMgmtAdminCenterDeviceUploadStatus (Issue #103)

It looks like you can get that same error if you do not have the AAD Tenant ID defined in CM. So, perhaps something missing in the co-management configuration in your site? Hard to say. I don't have access to a fully configured CM environment anymore. Job has changed and I don't spend much time with it anymore, so it's all a bit fuzzy.

— Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/103#issuecomment-1444826179, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOR7FPK6JGOSVM4INB4KQ3WZFJQNANCNFSM6AAAAAAVFM4SWI. You are receiving this because you were mentioned.Message ID: @.***>

NorbertBauer avatar Feb 25 '23 07:02 NorbertBauer

Possible it's changed. What build of CM you getting the errors in?

paulwetter avatar Feb 25 '23 08:02 paulwetter

CM 2207

Gesendet von Outlook für iOShttps://aka.ms/o0ukef


Von: Paul Wetter @.> Gesendet: Saturday, February 25, 2023 9:11:17 AM An: paulwetter/DocumentConfigMgrCB @.> Cc: NorbertBauer @.>; Mention @.> Betreff: Re: [paulwetter/DocumentConfigMgrCB] Error in function Get-PWCMCoMgmtAdminCenterDeviceUploadStatus (Issue #103)

Possible it's changed. What build of CM you getting the errors in?

— Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/103#issuecomment-1445026969, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOR7FPSR5U6FTQWKW7FBITWZG5CLANCNFSM6AAAAAAVFM4SWI. You are receiving this because you were mentioned.Message ID: @.***>

NorbertBauer avatar Feb 25 '23 10:02 NorbertBauer

On the co-management configuration, could you provide the details here. It is failing in collecting that page details. It seems it throws that error if wmi query has an incorrect tenant ID. Can you confirm that matches what was configured? Maybe there are other issues too.. But, that is what i'm seeing. image

paulwetter avatar Feb 25 '23 20:02 paulwetter

on this page, all settings are enabled and all devices are uploaded. Also the TenantID, that the Script reads from WMI ist the same, as shown in the console. And with each WMI query within this function, I do only get one Item, so there should be no issue with that.

NorbertBauer avatar Feb 27 '23 12:02 NorbertBauer

Ahhh... We do not specify "Upload specific collection" and therefore, this WMI Method will not find a Collection. Maybe the error is "by design" in that case?

NorbertBauer avatar Feb 27 '23 12:02 NorbertBauer