Fix and enhance PowerShell script for howto-authentication-use-email-…#1942
Fix and enhance PowerShell script for howto-authentication-use-email-…#1942Octavius97 wants to merge 2 commits intoMicrosoftDocs:mainfrom
Conversation
…signin.md Refactored and corrected the PowerShell script referenced in howto-authentication-use-email-signin.md to ensure accurate attribute usage, optimized property retrieval, and comprehensive user export coverage. Fix list: - **Optimized property retrieval:** Added the `-Property` parameter to the `Get-MgUser` cmdlet call to explicitly request only the necessary attributes, reducing unnecessary data overhead and improving query efficiency. - **Corrected sync status evaluation:** Updated the filtering logic in the `Where-Object` sections to properly identify synced vs. cloud-only users by leveraging the `OnPremisesSyncEnabled` attribute, replacing the previously used `ImmutableId` attribute which is not correct. - **Expanded export coverage:** Fixed the export query logic to correctly capture both on-premises synced users and cloud-only users, ensuring no affected accounts are excluded from the exported dataset. - **Improved export property labeling:** Enhanced the `Select-Object` section in the **Export block** to include the `ProxyAddresses` property and expose the `OnPremisesSyncEnabled` attribute, providing clearer and more actionable output for administrators reviewing the exported data.
|
@Octavius97 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit 8f405be: ✅ Validation status: passed
For more details, please refer to the build report. |
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
There was a problem hiding this comment.
Pull request overview
Updates the PowerShell example in the email sign-in troubleshooting section to use Microsoft Graph user properties more accurately when detecting UPN/proxyAddress conflicts between synced and cloud-only users.
Changes:
- Requests a specific set of user attributes via
Get-MgUser -Propertyto limit returned data. - Switches synced-vs-cloud-only detection to
OnPremisesSyncEnabledinstead ofImmutableId. - Adjusts the CSV export shape and adds proxy address formatting.
docs/identity/authentication/howto-authentication-use-email-signin.md
Outdated
Show resolved
Hide resolved
Changed the `ImmutableId` attribute in the `Select-Object` section to use the correct attribute `OnPremisesImmutableId` instead.
|
Learn Build status updates of commit 9af263e: ✅ Validation status: passed
For more details, please refer to the build report. |
Octavius97
left a comment
There was a problem hiding this comment.
Fixed the attributes to use the OnPremisesImmutableId attribute
Refactored and corrected the PowerShell script referenced in
howto-authentication-use-email-signin.mdto ensure accurate attribute usage, optimized property retrieval, and comprehensive user export coverage.Fix list:
Optimized property retrieval: Added the
-Propertyparameter to theGet-MgUsercmdlet call to explicitly request only the necessary attributes, reducing unnecessary data overhead and improving query efficiency.Corrected sync status evaluation: Updated the filtering logic in the
Where-Objectsections to properly identify synced vs. cloud-only users by leveraging theOnPremisesSyncEnabledattribute, replacing the previously usedImmutableIdattribute which is not correct.Expanded export coverage: Fixed the export query logic to correctly capture both on-premises synced users and cloud-only users, ensuring no affected accounts are excluded from the exported dataset.
Improved export property labeling: Enhanced the
Select-Objectsection in the Export block to include theProxyAddressesproperty and expose theOnPremisesSyncEnabledattribute, providing clearer and more actionable output for administrators reviewing the exported data.