All pastes #415985 Raw Edit

Anonymous

public text v1 · immutable
#415985 ·published 2007-03-30 00:03 UTC
rendered paste body
import os, socket
def getIPs():
	f = os.popen("net view")
	d = f.readlines()
	f.close()
	ips = []
	thiscomp = socket.gethostname().upper()
	for l in d:
		if l.startswith(r"\\"):
			name = l.split()[0][2:]
			if name != thiscomp:
				ips.append(socket.gethostbyname(name))
	return ips