Please use the script to know whether the user is active or not.

Code:
def IsUserActive(uName):
    import os
    proObj = os.popen('net user')
    activeUsers = proObj.read()
    return uName in activeUsers

passUserNameHere='purushothaman'
if IsUserActive(passUserNameHere):
    print 'Success: '+passUserNameHere+' is active'
else:
    print 'Fail: No User-'+passUserNameHere+' active!'
Sample Output:
Click image for larger version

Name:	IsUserActive.PNG
Views:	1
Size:	1.6 KB
ID:	4775