Closed AshleyYangSZ closed 2 years ago
@AshleyYangSZ
We recently added a new Cmdlet that allows you to search for cmdlets that correspond to a URL.
Find-MgGraphCommand
For Example:-
❯ Find-MgGraphCommand -Uri "https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword"
APIVersion: beta
Command Module Method URI OutputType Permissions Variants
------- ------ ------ --- ---------- ----------- --------
Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword DeviceManagement.Actions POST /deviceManagement/virtualEndpoint/onPremisesConnections/{cloudPcOnPremisesConnection-id}/updateAdDomainPassword {} {Update, UpdateExpanded, U…
Does the cmdlet Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword
achieve the desired results?
Thanks for looking into this @georgend!
@AshleyYangSZ, the HTTP snippet/docs is not correct in this case. In the snippet, updateAdDomainPassword
sends a PATCH
request, yet updateAdDomainPassword
is declared as an OData action in the metadata:
<Action Name="updateAdDomainPassword" IsBound="true">
<Parameter Name="bindingParameter" Type="graph.cloudPcOnPremisesConnection" />
<Parameter Name="adDomainPassword" Type="Edm.String" Unicode="false" />
</Action>
OData actions should always be POST
requests.
Hi @peombwa thanks for digging the reason, could you first add the Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword PS script first? Then we will switch to use POST in https request next month.
@AshleyYangSZ, the command is already available in the latest version of the SDK:
➜ Find-Command Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword | select ModuleName, Version
ModuleName Version
---------- -------
Microsoft.Graph.DeviceManagement.Actions 1.9.3
Thanks a lot! @peombwa we really appreciated your effort on this.
See this link https://docs.microsoft.com/en-us/graph/api/cloudpconpremisesconnection-updateaddomainpassword?view=graph-rest-beta&tabs=http No PowerShell script generate for this API