當前位置: 首頁>>代碼示例>>Python>>正文


Python DSAdminHarness.modify_s方法代碼示例

本文整理匯總了Python中bug_harness.DSAdminHarness.modify_s方法的典型用法代碼示例。如果您正苦於以下問題:Python DSAdminHarness.modify_s方法的具體用法?Python DSAdminHarness.modify_s怎麽用?Python DSAdminHarness.modify_s使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bug_harness.DSAdminHarness的用法示例。


在下文中一共展示了DSAdminHarness.modify_s方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: str

# 需要導入模塊: from bug_harness import DSAdminHarness [as 別名]
# 或者: from bug_harness.DSAdminHarness import modify_s [as 別名]
       (ldap.MOD_ADD, 'ntUserDomainId', uid)]
ds.modify_s(ent.dn, mod)
time.sleep(1)
print "Added ntuser, changing telephonenumber . . ."
mod = [(ldap.MOD_DELETE, 'telephoneNumber', telnum1),
       (ldap.MOD_ADD, 'telephoneNumber', telnum2)]
ds.modify_s(ent.dn, mod)
time.sleep(1)
print "changed telephonenumber, changing description . . ."
mod = [(ldap.MOD_ADD, 'description', 'test bug471068')]
ds.modify_s(ent.dn, mod)
time.sleep(1)

print "Delete description in AD, then in DS . . ."
mod = [(ldap.MOD_DELETE, 'description', None)]
ad.modify_s(adent.dn, mod)
ds.modify_s(ent.dn, mod)

time.sleep(1)
print "Add description in AD, then in DS . . ."
mod = [(ldap.MOD_ADD, 'description', 'test bug471068')]
ad.modify_s(adent.dn, mod)
ds.modify_s(ent.dn, mod)

time.sleep(1)
print "Now compare the entries . . ."
ents = ds.search_s(suffix, scope, "(uid=%s)" % uid)
print "DS Entry: ", str(ents[0])
ents = ad.search_s(suffix, scope, "(samaccountname=%s)" % uid)
print "AD Entry: ", str(ents[0])
開發者ID:axdxnco,項目名稱:scripts,代碼行數:32,代碼來源:bug471068.py


注:本文中的bug_harness.DSAdminHarness.modify_s方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。