<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RestAPI: Add userGroup members not working in Intel vPro® Platform</title>
    <link>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1452180#M9755</link>
    <description>&lt;P&gt;Using the following POST method via PowerShell:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://localhost" target="_blank" rel="noopener"&gt;https://localhost&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api/v5/userGroupMemberships/{userGroupId}/addMembers&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I set the body as&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$UPN=@()&lt;BR /&gt;$UPN+="Julian.Loveday@mydomain.com"&lt;/P&gt;
&lt;P&gt;#// Add to User Group&lt;BR /&gt;$Body = @{ &lt;BR /&gt;'UserName'=$UPN&lt;BR /&gt;}&lt;BR /&gt;$JSON=$Body | ConvertTo-Json&lt;BR /&gt;$UserGroup=Invoke-RestMethod "&lt;A href="https://ema.mydomain.com/api/latest/userGroupMemberships/$EMAUserGroupId/addMembers" target="_blank" rel="noopener"&gt;https://ema.mydomain.com/api/latest/userGroupMemberships/$EMAUserGroupId/addMembers&lt;/A&gt;" -Headers $headers -Body $JSON -Method Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however I see this error every time:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jools86_0-1675255813244.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/37639i7EB293E9B67BA26B/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Jools86_0-1675255813244.png" alt="Jools86_0-1675255813244.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried changing to&lt;/P&gt;
&lt;P&gt;$UserGroup=Invoke-RestMethod "&lt;A href="https://ema.mlp.com/api/latest/userGroupMemberships/$($EMAUserGroupId)/addMembers" target="_blank" rel="noopener"&gt;https://ema.mlp.com/api/latest/userGroupMemberships/$($EMAUserGroupId)/addMembers&lt;/A&gt;" -Headers $headers -Body $JSON -Method Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and even changing to&lt;/P&gt;
&lt;P&gt;$UserGroup=Invoke-RestMethod "&lt;A href="https://ema.mlp.com/api/latest/userGroupMemberships/1/addMembers" target="_blank" rel="noopener"&gt;https://ema.mlp.com/api/latest/userGroupMemberships/1/addMembers&lt;/A&gt;" -Headers $headers -Body $JSON -Method Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you either:&lt;/P&gt;
&lt;P&gt;a) C&lt;SPAN&gt;onfirm there is a BUG in the RestAPI for adding members &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or b) Send me an example if I am getting the syntax wrong.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an FYI, token generates fine (code to generate headers below) - and I can run most other RestAPI queries using the below, its this specific one (&lt;SPAN&gt;&lt;A href="https://localhost" target="_blank" rel="noopener"&gt;https://localhost&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api/v5/userGroupMemberships/{userGroupId}/addMembers)&lt;/SPAN&gt; that is broken.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#// Generate token to be passed for authorization with each RestAPI request&lt;BR /&gt;$Token=Invoke-RestMethod "&lt;A href="https://mydomain.mlp.com/api/latest/accessTokens/getUsingWindowsCredentials" target="_blank"&gt;https://mydomain.mlp.com/api/latest/accessTokens/getUsingWindowsCredentials&lt;/A&gt;" -Credential $Cred&lt;/P&gt;
&lt;P&gt;#// Generate header including token for each API request&lt;BR /&gt;$headers = @{&lt;BR /&gt;'authorization' = "bearer $($Token.access_token)"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2023 12:54:11 GMT</pubDate>
    <dc:creator>Jools86</dc:creator>
    <dc:date>2023-02-01T12:54:11Z</dc:date>
    <item>
      <title>RestAPI: Add userGroup members not working</title>
      <link>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1452180#M9755</link>
      <description>&lt;P&gt;Using the following POST method via PowerShell:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://localhost" target="_blank" rel="noopener"&gt;https://localhost&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api/v5/userGroupMemberships/{userGroupId}/addMembers&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I set the body as&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$UPN=@()&lt;BR /&gt;$UPN+="Julian.Loveday@mydomain.com"&lt;/P&gt;
&lt;P&gt;#// Add to User Group&lt;BR /&gt;$Body = @{ &lt;BR /&gt;'UserName'=$UPN&lt;BR /&gt;}&lt;BR /&gt;$JSON=$Body | ConvertTo-Json&lt;BR /&gt;$UserGroup=Invoke-RestMethod "&lt;A href="https://ema.mydomain.com/api/latest/userGroupMemberships/$EMAUserGroupId/addMembers" target="_blank" rel="noopener"&gt;https://ema.mydomain.com/api/latest/userGroupMemberships/$EMAUserGroupId/addMembers&lt;/A&gt;" -Headers $headers -Body $JSON -Method Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however I see this error every time:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jools86_0-1675255813244.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/37639i7EB293E9B67BA26B/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Jools86_0-1675255813244.png" alt="Jools86_0-1675255813244.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried changing to&lt;/P&gt;
&lt;P&gt;$UserGroup=Invoke-RestMethod "&lt;A href="https://ema.mlp.com/api/latest/userGroupMemberships/$($EMAUserGroupId)/addMembers" target="_blank" rel="noopener"&gt;https://ema.mlp.com/api/latest/userGroupMemberships/$($EMAUserGroupId)/addMembers&lt;/A&gt;" -Headers $headers -Body $JSON -Method Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and even changing to&lt;/P&gt;
&lt;P&gt;$UserGroup=Invoke-RestMethod "&lt;A href="https://ema.mlp.com/api/latest/userGroupMemberships/1/addMembers" target="_blank" rel="noopener"&gt;https://ema.mlp.com/api/latest/userGroupMemberships/1/addMembers&lt;/A&gt;" -Headers $headers -Body $JSON -Method Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you either:&lt;/P&gt;
&lt;P&gt;a) C&lt;SPAN&gt;onfirm there is a BUG in the RestAPI for adding members &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or b) Send me an example if I am getting the syntax wrong.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an FYI, token generates fine (code to generate headers below) - and I can run most other RestAPI queries using the below, its this specific one (&lt;SPAN&gt;&lt;A href="https://localhost" target="_blank" rel="noopener"&gt;https://localhost&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api/v5/userGroupMemberships/{userGroupId}/addMembers)&lt;/SPAN&gt; that is broken.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#// Generate token to be passed for authorization with each RestAPI request&lt;BR /&gt;$Token=Invoke-RestMethod "&lt;A href="https://mydomain.mlp.com/api/latest/accessTokens/getUsingWindowsCredentials" target="_blank"&gt;https://mydomain.mlp.com/api/latest/accessTokens/getUsingWindowsCredentials&lt;/A&gt;" -Credential $Cred&lt;/P&gt;
&lt;P&gt;#// Generate header including token for each API request&lt;BR /&gt;$headers = @{&lt;BR /&gt;'authorization' = "bearer $($Token.access_token)"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 12:54:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1452180#M9755</guid>
      <dc:creator>Jools86</dc:creator>
      <dc:date>2023-02-01T12:54:11Z</dc:date>
    </item>
    <item>
      <title>Re:RestAPI: Add userGroup members not working</title>
      <link>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1452673#M9756</link>
      <description>&lt;P&gt;Hello Jools86,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for posting on the Intel® communities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me review this information internally, and kindly wait for an update. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once we have more information to share, we will post it on this thread. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Victor G. &lt;/P&gt;&lt;P&gt;Intel Technical Support Technician&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Feb 2023 16:39:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1452673#M9756</guid>
      <dc:creator>Victor_G_Intel</dc:creator>
      <dc:date>2023-02-02T16:39:19Z</dc:date>
    </item>
    <item>
      <title>Re:RestAPI: Add userGroup members not working</title>
      <link>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1456598#M9772</link>
      <description>&lt;P&gt;Hello Jools86,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your patience.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;After analyzing your request, we have come to the conclusion that this is not a bug, but a syntax issue. It looks like you are attempting to use an array $UPN=@()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Swagger syntax calls for the UPN to be a call for a "string"... "UserName": "string"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you remove the array and turn it into a string it should work fine:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#Example&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$UPN="Julian.Loveday@mydomain.com"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#// Add to User Group&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$Body = @{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;'UserName'=$UPN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$JSON=$Body | ConvertTo-Json&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Write-Host $JSON&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;the output will look like as opposed to nothing in an array&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;"UserName":&amp;nbsp;"Julian.Loveday@mydomain.com"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Victor G. &lt;/P&gt;&lt;P&gt;Intel Technical Support Technician&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2023 16:05:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1456598#M9772</guid>
      <dc:creator>Victor_G_Intel</dc:creator>
      <dc:date>2023-02-16T16:05:53Z</dc:date>
    </item>
    <item>
      <title>Re:RestAPI: Add userGroup members not working</title>
      <link>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1458451#M9779</link>
      <description>&lt;P&gt;Hello Jools86,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Were you able to check the previous post?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need further assistance.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor G.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Intel Technical Support Technician&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Feb 2023 00:19:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1458451#M9779</guid>
      <dc:creator>Victor_G_Intel</dc:creator>
      <dc:date>2023-02-23T00:19:39Z</dc:date>
    </item>
    <item>
      <title>Re:RestAPI: Add userGroup members not working</title>
      <link>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1459791#M9790</link>
      <description>&lt;P&gt;Hello Jools86,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We have not heard back from you. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you need any additional information, please submit a new question as this thread will no longer be monitored. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Victor G. &lt;/P&gt;&lt;P&gt;Intel Technical Support Technician&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Feb 2023 16:44:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-vPro-Platform/RestAPI-Add-userGroup-members-not-working/m-p/1459791#M9790</guid>
      <dc:creator>Victor_G_Intel</dc:creator>
      <dc:date>2023-02-27T16:44:01Z</dc:date>
    </item>
  </channel>
</rss>

