1 回答

TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個(gè)贊
要從 GO SDK 創(chuàng)建用戶(hù),您可以使用此 MsDoc中提到的以下示例代碼:
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewUser()
accountEnabled := true
requestBody.SetAccountEnabled(&accountEnabled)
displayName := "User1"
requestBody.SetDisplayName(&displayName)
mailNickname := "test"
requestBody.SetMailNickname(&mailNickname)
userPrincipalName := "user1@contoso.onmicrosoft.com"
requestBody.SetUserPrincipalName(&userPrincipalName)
passwordProfile := msgraphsdk.NewPasswordProfile()
requestBody.SetPasswordProfile(passwordProfile)
forceChangePasswordNextSignIn := true
passwordProfile.SetForceChangePasswordNextSignIn(&forceChangePasswordNextSignIn)
password := "*********"
passwordProfile.SetPassword(&password)
result, err := graphClient.Users().Post(requestBody)
要了解如何將 GO SDK 與 Azure Ad 集成,您可以參考以下鏈接:
安裝 Microsoft Graph SDK - Microsoft Graph | 微軟文檔
- 1 回答
- 0 關(guān)注
- 98 瀏覽
添加回答
舉報(bào)