DSGet is a Windows command-line tool used to interact with Active Directory Domain Services (AD DS). I came across some commands I’d written down earlier this year and thought I’d post them here for later recall.
To list direct members of a group:
DSGet group "CN=GroupName, OU=OrganizationalUnit, DC=domain, DC=tld" -members
To list all of the group’s members (including members of a group that is a member of the group in question):
DSGet group "CN=GroupName, OU=OrganizationalUnit, DC=domain, DC=tld" -members -expand
To list the direct group membership of a user:
DSGet user "CN=UserName, OU=OrganizationalUnit, DC=domain, DC=tld" -memberof
To list full group membership of a user (like a recursive list, so-to-speak):
DSGet user "CN=UserName, OU=OrganizationalUnit, DC=domain, DC=tld" -memberof -expand
And a PowerShell command (cmdlet) to show the sAMAccountName(s) of the members of a group:
Get-ADGroupMember "GroupName" -recursive | Select sAMAccountName
I know this is far from an exhaustive list of commands, but at least now I can throw that ratty sheet of notebook paper away.
I’ve been through this before and had to look it up again today. This post is simply a reminder for the inevitable next time I can’t remember it.
I typically install CentOS on a box or in a VM with minimal packages so I can bring in only what I need. I did just such a thing yesterday to have a machine I can use to rsync data here and there, and do some remote administration.
One primary purpose was to take my backup drives from my house and sync to a share on a storage array at work. This serves as my off-site backup consolidation.
Instead of tying up a Windows machine and using their experimental SyncToy (which has been performing worse and worse lately), I chose to use a Linux-powered data management machine. It will eventually synchronize the local backups at home to the storage array at work, but there’s only so much time…
Anyway, my little 1TB external drives are formatted in NTFS, and we all know that’s not a native Linux filesystem. We’ll have to install a library. We had to do the same thing to mount a Windows network share (CIFS), a library which was readily available in the default YUM repository – no problem.
The utility needed for NTFS is not, however. It’s found in the Extra Packages for Enterprise Linux (EPEL) repository, available from the Fedora project. This is a very long way of saying that you need to enable the EPEL repo by installing the proper RPM (currently available here for EL6 x86_64), and then install the ntfs-3g NTFS userspace library package with YUM.
Keep in mind that there are a lot of other cool things in EPEL, but at present you just need to remember this one.