{"id":1055,"date":"2011-11-11T11:56:26","date_gmt":"2011-11-11T02:56:26","guid":{"rendered":"http:\/\/wp.kaz.bz\/tech\/?p=1055"},"modified":"2013-11-14T18:18:52","modified_gmt":"2013-11-14T09:18:52","slug":"activedirectory-%e3%81%ae%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%ad%e3%83%83%e3%82%af%e3%82%a2%e3%82%a6%e3%83%88%e8%a7%a3%e9%99%a4%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%ef%bc%88vbs%ef%bc%89","status":"publish","type":"post","link":"https:\/\/wp.kaz.bz\/tech\/2011\/11\/11\/1055.html","title":{"rendered":"ActiveDirectory \u306e\u30e6\u30fc\u30b6\u30ed\u30c3\u30af\u30a2\u30a6\u30c8\u89e3\u9664\u30b9\u30af\u30ea\u30d7\u30c8\uff08VBS\uff09"},"content":{"rendered":"<p>ActiveDirectory\u3067\u30a2\u30ab\u30a6\u30f3\u30c8\u30ed\u30c3\u30af\u304c\u304b\u304b\u3063\u305f\u30e6\u30fc\u30b6\u306e\u30ed\u30c3\u30af\u89e3\u9664\u3092\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002<br \/>\n\u30c9\u30e1\u30a4\u30f3\u306e\u7ba1\u7406\u8005\u6a29\u9650\u304c\u306a\u3044\u3068\u52d5\u304b\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush:vb\">\r\n' ActiveDirectory\u30c9\u30e1\u30a4\u30f3\u540d\r\nConst DOMAIN_NAME = \"AD\u306e\u30c9\u30e1\u30a4\u30f3\u540d\"\r\n\r\n' \u30ed\u30c3\u30af\u30a2\u30a6\u30c8\u89e3\u9664\u30e1\u30a4\u30f3\r\nFunction unlock_account(strAccount)\r\n\tDim tmpRet\r\n\t\r\n\tDim objUser\r\n\tDim strDomain\r\n\t\r\n\tOn Error Resume Next\r\n\t\tSet objUser = GetObject(\"WinNT:\/\/\" & DOMAIN_NAME & \"\/\" & strAccount & \",user\")\r\n\t\tIf Len(Err.Description) > 0 Then\r\n\t\t\ttmpRet = \"Error:1:\" & Err.Description\r\n\t\tElse\r\n\t\t\tIf objUser.IsAccountLocked Then\r\n\t\t\t\tobjUser.IsAccountLocked = False\r\n\t\t\t\tobjUser.SetInfo \r\n\t\t\t\tIf Len(Err.Description) > 0 Then\r\n\t\t\t\t\ttmpRet = \"Error:2:\" & Err.Description\r\n\t\t\t\tElse\r\n\t\t\t\t\ttmpRet = \"\u5b8c\u4e86\"\r\n\t\t\t\tEnd If\r\n\t\t\tElse\r\n\t\t\t\ttmpRet = \"\u30ed\u30c3\u30af\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\"\r\n\t\t\tEnd If\r\n\r\n\t\t\tIf Len(Err.Description) > 0 Then\r\n\t\t\t\ttmpRet = \"Error:3:\" & Err.Description\r\n\t\t\tEnd If\r\n\t\tEnd If\r\n\t\tSet objUser = Nothing\r\n\tOn Error Goto 0\r\n\r\n\tunlock_account = tmpRet\r\nEnd Function\r\n\r\n\r\n' \u30e6\u30fc\u30b6\u5165\u529b\u753b\u9762\u8868\u793a\r\nSub Main()\r\n\tDim strUser\r\n\tstrUser = inputbox(\"\u30ed\u30c3\u30af\u89e3\u9664\u3059\u308b\u30e6\u30fc\u30b6\u540d\")\r\n\t\r\n\tIf strUser = \"\" Then\r\n\t\tmsgbox \"\u51e6\u7406\u3092\u4e2d\u6b62\u3057\u307e\u3057\u305f\u3002\"\r\n\tElse\r\n\t\tmsgbox unlock_account(strUser)\r\n\tEnd If\r\nEnd Sub\r\n\r\nMain\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ActiveDirectory\u3067\u30a2\u30ab\u30a6\u30f3\u30c8\u30ed\u30c3\u30af\u304c\u304b\u304b\u3063\u305f\u30e6\u30fc\u30b6\u306e\u30ed\u30c3\u30af\u89e3\u9664\u3092\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002 \u30c9\u30e1\u30a4\u30f3\u306e\u7ba1\u7406\u8005\u6a29\u9650\u304c\u306a\u3044\u3068\u52d5\u304b\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 ' ActiveDirectory\u30c9\u30e1\u30a4\u30f3\u540d Const DOMA [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[66],"tags":[],"class_list":["post-1055","post","type-post","status-publish","format-standard","hentry","category-activedirectory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":5,"url":"https:\/\/wp.kaz.bz\/tech\/2009\/11\/05\/5.html","url_meta":{"origin":1055,"position":0},"title":"ActiveDirectory\u30a2\u30ab\u30a6\u30f3\u30c8\u30ed\u30c3\u30af\u89e3\u9664\u30b9\u30af\u30ea\u30d7\u30c8\u3002","author":"kaz. Suenaga","date":"2009\/11\/05","format":false,"excerpt":"' ActiveDirectory\u30c9\u30e1\u30a4\u30f3\u540d Const DOMAIN_NAME = \"exampl\u2026","rel":"","context":"Windows","block_context":{"text":"Windows","link":"https:\/\/wp.kaz.bz\/tech\/category\/windows"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1468,"url":"https:\/\/wp.kaz.bz\/tech\/2013\/01\/11\/1468.html","url_meta":{"origin":1055,"position":1},"title":"Access VBA\uff1a 64bit \u3067\u3082 32bit \u3067\u3082DAO\u3092\u52d5\u304b\u3059\u65b9\u6cd5\uff08\u691c\u8a3c\u4e2d\uff09\u3002","author":"kaz. Suenaga","date":"2013\/01\/11","format":false,"excerpt":"Access2010 \u4ee5\u964d\u3001DAO\u306e\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u304c \"Microsoft Office 14.0 \u2026","rel":"","context":"VBA\uff0fASP\u306a\u3069","block_context":{"text":"VBA\uff0fASP\u306a\u3069","link":"https:\/\/wp.kaz.bz\/tech\/category\/langs\/vba_asp_etc"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27,"url":"https:\/\/wp.kaz.bz\/tech\/2008\/12\/09\/27.html","url_meta":{"origin":1055,"position":2},"title":"VBA\u3067\u914d\u5217\u306b\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b","author":"kaz. Suenaga","date":"2008\/12\/09","format":false,"excerpt":"\u3044\u3061\u3044\u3061Redim\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067Sub\u306b\u307e\u3068\u3081\u308b\u3002 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u914d\u5217\u5bfe\u5fdc\u306e\u3064\u3082\u308a\uff08\u672a\u691c\u8a3c\uff09\u3002 '\u2026","rel":"","context":"VBA\uff0fASP\u306a\u3069","block_context":{"text":"VBA\uff0fASP\u306a\u3069","link":"https:\/\/wp.kaz.bz\/tech\/category\/langs\/vba_asp_etc"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":852,"url":"https:\/\/wp.kaz.bz\/tech\/2011\/06\/03\/852.html","url_meta":{"origin":1055,"position":3},"title":"postfix + dovecot \u3067\u4eee\u60f3\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3002","author":"kaz. Suenaga","date":"2011\/06\/03","format":false,"excerpt":"postfix + dovecot \u3067\u4eee\u60f3\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3002 \u30c6\u30b9\u30c8\u9001\u4fe1\uff0b\u53d7\u4fe1\u4ed8\u3002\u2026","rel":"","context":"postfix_dovecot","block_context":{"text":"postfix_dovecot","link":"https:\/\/wp.kaz.bz\/tech\/category\/servers\/postfix_dovecot"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6,"url":"https:\/\/wp.kaz.bz\/tech\/2009\/10\/09\/6.html","url_meta":{"origin":1055,"position":4},"title":"\u30de\u30eb\u30c1Ping","author":"kaz. Suenaga","date":"2009\/10\/09","format":false,"excerpt":"\u203b\u81ea\u5206\u3067\u7ba1\u7406\u3057\u3066\u3044\u308b\u9818\u57df\u4ee5\u5916\u306b\u5b9f\u884c\u3057\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7ba1\u7406\u7528\u306b\u3002 \u5b9f\u969b\u306b\u306f sh \u30b9\u30af\u30ea\u2026","rel":"","context":"\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\uff08\u4e3b\u306bbash\uff09","block_context":{"text":"\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\uff08\u4e3b\u306bbash\uff09","link":"https:\/\/wp.kaz.bz\/tech\/category\/langs\/shellscript"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":39,"url":"https:\/\/wp.kaz.bz\/tech\/2008\/06\/18\/39.html","url_meta":{"origin":1055,"position":5},"title":"vpopmail\u306e\u5168\u30c9\u30e1\u30a4\u30f3\u30fb\u5168\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3002","author":"kaz. Suenaga","date":"2008\/06\/18","format":false,"excerpt":"vpopmail\u306e\u5168\u30d0\u30fc\u30c1\u30e3\u30eb\u30c9\u30e1\u30a4\u30f3\u30fb\u5168\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u76ee\u7684\u3068\u3057\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3002 va\u2026","rel":"","context":"qmail \/ vpopmail","block_context":{"text":"qmail \/ vpopmail","link":"https:\/\/wp.kaz.bz\/tech\/category\/servers\/djb\/qmail-vpopmail"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/posts\/1055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/comments?post=1055"}],"version-history":[{"count":0,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/posts\/1055\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/media?parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/categories?post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/tags?post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}