0

Hi,

I'm looking for a way to getthe domain a computer is connected to and the name of the domain controller if possible. I've looked at the os, socket and platform and can't find anything. I have been able to retrieve various bits of system info using these modules but not the domain.

I have been able to get the fully qualified domain name using socket.getfqdn() and I know with a bit of work I can remove the hostname to get the domain the computer is attached to but I don't want to reinvent the wheel if there is a function that all ready exists.

I don't want to use the win32com module either as I was this to be cross platform.

Thanks

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by MarcusMaximus
0

Is there a way to edit posts. The code to get the domain using a work around is:

import socket
print socket.getfqdn().replace(socket.gethostname() + ".","")

I'd still perfer to know if there is a function that I'm missing.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.