Skip to content

Instantly share code, notes, and snippets.

@acidprime
Created September 11, 2013 17:58
Show Gist options
  • Save acidprime/6527333 to your computer and use it in GitHub Desktop.
Save acidprime/6527333 to your computer and use it in GitHub Desktop.
Get a 10.6 style AD Password using the bridge
#!/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python
from Cocoa import NSDictionary
def getTGTpassword():
path = '/Library/Preferences/DirectoryService/ActiveDirectory.plist'
plist = NSDictionary.dictionaryWithContentsOfFile_(path)
if 'AD Computer Password' in plist:
nsdata = plist['AD Computer Password']
print nsdata
else:
print 'This machine does not appear to have a password'
getTGTpassword()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment