microsoft:activedirectory:scripting:powershell:notes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| microsoft:activedirectory:scripting:powershell:notes [2026/11/27 14:07] – Corrected the display of the code block at [Export users with (nested) group memberships]. bas | microsoft:activedirectory:scripting:powershell:notes [2026/11/27 14:12] (current) – Added 2 variables to script at [Export users with (nested) group memberships]. bas | ||
|---|---|---|---|
| Line 161: | Line 161: | ||
| <code powershell> | <code powershell> | ||
| - | $objUsers | + | $strSearchBase |
| + | $strUsersGroupMembershipsExportCsv = " | ||
| + | |||
| + | $objUsers = Get-ADUser -SearchBase $strSearchBase | ||
| $objResult = @() | $objResult = @() | ||
| Line 169: | Line 172: | ||
| $objUserGroups = Get-ADObject -LDAPFilter " | $objUserGroups = Get-ADObject -LDAPFilter " | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | $objTemp.GroupName = $objUserGroup.Name | + | $objTemp.GroupName = $objUserGroup.Name |
| - | $objResult += $objTemp | + | $objResult += $objTemp |
| - | | + | |
| } | } | ||
| - | $objResult | Export-Csv -NoTypeInformation -Encoding UTF8 -Path " | + | $objResult | Export-Csv -NoTypeInformation -Encoding UTF8 -Path $strUsersGroupMembershipsExportCsv |
| </ | </ | ||
microsoft/activedirectory/scripting/powershell/notes.txt · Last modified: by bas
