-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #3093 #3121
Fix #3093 #3121
Conversation
…o examples-test-fixes
@microsoft-github-policy-service agree |
Could you please add an entry in the changelog under UNRELEASED |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment
@@ -462,51 +462,59 @@ function Set-TargetResource | |||
} | |||
#endregion | |||
|
|||
if ($null -ne $Password) | |||
if ($user.UserPrincipalName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add:
$null -ne $user.UserPrincipalName
|
||
$stringPassword = (Get-Random -Count 15 -InputObject $StringSet) -join '' | ||
$passwordValue = ConvertTo-SecureString $stringPassword -AsPlainText -Force | ||
$stringPassword = (Get-Random -Count 15 -InputObject $StringSet) -join '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We create a 30 character password above. We should do the same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i intentionally didn't touch this code as it was already in the module and didn't want to commit changes out of scope of the original issue (#3093)
in my opinion the resource should only use one method to generate passwords and [system.web.security.membership] should be removed. i can prepare the code change and open a separate issue/pr for this.
@@ -11,7 +11,7 @@ | |||
| **Roles** | Write | StringArray[] | The list of Azure Active Directory roles assigned to the user. | | | |||
| **UsageLocation** | Write | String | The country code the user will be assigned to | | | |||
| **LicenseAssignment** | Write | StringArray[] | The account SKU Id for the license to be assigned to the user | | | |||
| **Password** | Write | PSCredential | The password for the account. The parameter is a PSCredential object, but only the Password component will be used | | | |||
| **Password** | Write | PSCredential | The password for the account. The parameter is a PSCredential object, but only the Password component will be used. If Password is not supplied for a new resource a new random password will be generated. Property will only be used when creating the user and not on subsequent updates. | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated based on the information in the schema. Could you please also update the description of the Password parameter in the schema.mof, so this change isn't rolled back when the file is generated again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last comment
Modules/Microsoft365DSC/DSCResources/MSFT_AADUser/MSFT_AADUser.schema.mof
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the PR!
LGTM
Pull Request (PR) description
changed "Modules\Microsoft365DSC\DSCResources\MSFT_AADUser\MSFT_AADUser.psm1" to ignore the property "Password" on updates.
added a note to "docs\docs\resources\azure-ad\AADUser.md"
This Pull Request (PR) fixes the following issues
#3093