Skip to content

Instantly share code, notes, and snippets.

@pmbuko
Created July 16, 2013 14:22
Show Gist options
  • Save pmbuko/6009186 to your computer and use it in GitHub Desktop.
Save pmbuko/6009186 to your computer and use it in GitHub Desktop.
Add to your .bashrc. Works on an AD-bound mac with directory search path set up properly. 'getsid [username]' will return the user's SID.
getsid () { dscl localhost -read /Search/Users/$1 SMBSID 2>/dev/null | awk '{print $2}'; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment