リストからユーザーに自動的にログオンするPythonスクリプトを書いています。このスクリプトは、アクティビティが少ないためにアカウントが無効になるのを防ぐために、月に1回実行されます。以下は作業コードです:
import win32security
import getpass
accounts = {'user1':'password1', 'user2':'password2', 'user3':'password3'}
for username, password in accounts.items():
handle = win32security.LogonUser(username, "DOMAIN", password, win32security.LOGON32_LOGON_INTERACTIVE, win32security.LOGON32_PROVIDER_DEFAULT)
print username.upper() + ': ' + repr(bool(handle))
handle.close()
私の質問は、win32security.LogonUser()がActiveDirectoryの「最後にログオンした」タイムスタンプを更新するかどうかです。Active Directoryサーバーに対する管理者権限を持たずにこれを実現する別の方法はありますか?
ありがとう
ウォル