active_directory
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
active_directory [2019/09/03 02:01] – stephen | active_directory [2021/04/06 09:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Active Directory ====== | ====== Active Directory ====== | ||
+ | |||
+ | ===== Basic Account Check ===== | ||
+ | |||
+ | <code powershell> | ||
+ | net user username /domain | ||
+ | </ | ||
===== Get Group Membership ===== | ===== Get Group Membership ===== | ||
+ | |||
+ | To get just the top level groups: | ||
+ | <code powershell> | ||
+ | Get-ADPrincipalGroupMembership -Identity $env: | ||
+ | Get-ADPrincipalGroupMembership -Identity ' | ||
+ | </ | ||
+ | |||
+ | To get **all** groups: | ||
+ | < | ||
+ | whoami /groups | ||
+ | whoami /groups | out-file group.txt | ||
+ | </ | ||
+ | |||
+ | ===== Get Group Membership - Alternatives ===== | ||
This generates a whole heap of crap - the security groups are at the end. This also seems to recurse down the groups or something - it lists more groups than the other options. | This generates a whole heap of crap - the security groups are at the end. This also seems to recurse down the groups or something - it lists more groups than the other options. | ||
< | < | ||
gpresult /R | gpresult /R | ||
- | </ | ||
- | |||
- | Try this: | ||
- | <code powershell> | ||
- | Get-ADPrincipalGroupMembership -Identity $env: | ||
- | Get-ADPrincipalGroupMembership -Identity ' | ||
</ | </ | ||
Line 28: | Line 42: | ||
<code powershell> | <code powershell> | ||
(New-Object System.DirectoryServices.DirectorySearcher(" | (New-Object System.DirectoryServices.DirectorySearcher(" | ||
+ | </ | ||
+ | |||
+ | ===== Get Local Admins ===== | ||
+ | |||
+ | < | ||
+ | net localgroup administrators | ||
+ | </ | ||
+ | |||
+ | ===== Get Members of a Group ===== | ||
+ | |||
+ | <code powershell> | ||
+ | Get-ADGroupMember "X3 NZ Provoke Developers" | ||
</ | </ | ||
active_directory.1567476094.txt.gz · Last modified: 2019/09/04 03:01 (external edit)