-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathADShortcuts
More file actions
23 lines (20 loc) · 875 Bytes
/
ADShortcuts
File metadata and controls
23 lines (20 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Command Prompt
net user USERNAME /domain
net group <your_groupname> /domain
net localgroup <your_groupname> /domain
whoami /groups
gpresult /R
gpresult /V
squery group -samid "Group_SAM_Account_Name" | dsget group -members -expand
dsquery group -name "Group Account Name" | dsget group -members -expand
net group groupname /add
net group groupName userName /ADD /DOMAIN
net group groupName
PowerShell
Import-Module ActiveDirectory
Get-ADGroupMember -Identity AllowUSB -Recursive | ft name
Get-ADGroupMember "Domain Admins" -recursive | Select-Object name
Get-ADGroupMember -Identity AllowUSB | foreach { Get-ADUser $_ -Properties * }
Get-ADPrincipalGroupMembership jbrion | Select name
Get-ADUser jbrion -Properties Memberof | Select -ExpandProperty memberOf
Get-ADPrincipalGroupMembership jbrion | where {$_ -like "*allow*"} | Sort-Object | select -ExpandProperty name