-
Notifications
You must be signed in to change notification settings - Fork 46
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
New Feature - Compare Accounts (group memberships mostly, possibly other types...) #54
Comments
Maybe we can create a Compare-ADSIUserMembership cmdlet
the main code consisting of fetching both users groups, storing the result in 2 hashtables (fast) and outputting any group, in the first hashtable, not present in the second hashtable. Output could be a psobject consisting of a 3 properties : Identity, ReferenceIdentity, NotMemberOf For a second iteration of the cmdlet we could add pipeline support, where you pipe idendities, and the cmdlet will only support the -ReferenceIdentity parameter
|
I actually really like the idea, as i would have a good use case for it. i agree with the cmdlet description of @LxLeChat. it would be nice to have the following features:
this could be implement using a switch -GetMissing (where the default behaviour would be to return an array of identical groups with the identity name. i could image the object return could be somewhat like this: Identity [object of type identity] Group, [array of groups] to be discussed of course :) |
Thanks @LxLeChat @Stephanevg for looking at this! These are some good ideas. Here are my thoughts for this function: ScopeI think this function should cover "Account" types, which mean User, Computer, Group and Service account types Properties to evaluate
Not sure all the account types have these properties, this could be evaluated at the beginning of the prop Other idea
|
As discussed on the chat, we can also try to rely on function Compare-ADSIObject
{param($ReferenceObject,$DifferenceObject,$Property)
# possibly use @PSBoundParameters ?
Compare-Object -ReferenceObject $ReferenceObject -DifferenceObject $DifferenceObject -Properties $property
}
Compare-ADSIObject -ReferenceObject contoso\myaccountA -DifferenceObject contoso\myaccountB -Properties memberof |
Hi @lazywinadmin I agree on -not to reinvinte the wheel- and using compare-Object, to write a I would suggest that the |
@Stephanevg 👍 this was what i had in mind as a step two 😄 |
I tried this, it works.. pretty slow but it works... :) `
} ` |
Hey guys, as i talked in the slack channel, i was working on my functions to make an Audit about AD groups in my team at work. I Adapted them to fit AdsiPS, i just made PR. |
Thanks for your work @LxLeChat @christophekumor ! Feel free to PR if you notice any gaps |
It would be nice to be able to compare accounts to detect missing group membership for examples
The text was updated successfully, but these errors were encountered: