惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - 尼斯湖李

traceback 6个Google Wave邀请,有要的快来!! 好用js城市联动下拉框 好久不来园子了 好想念大家 危机意识[reproduce] 人月神话:微软开发模式和原则[转] 博客园 Gmail邀请大放送 一些常用的javascript函数(方法) 到底什么是Upnp?[转载] Windows XP 网络共享问题--开启高级共享 免费电话时代已经到来,而且话音超清晰,比globe7强多了。 IBM系列笔记本删除Access IBM隐藏分区 让XP和2003自动登录 之 vbs脚本篇 让XP和2003自动登录 之 注册表篇 让XP和2003自动登录 心灵箴言,领悟后豁然开朗[转载] 爱迪生欺骗了世界![转载] 搜罗的几个APE的音乐网站 WiMAX vs 3G颠覆还是补充?[转载]
vbs脚本(管理本地用户和组)
尼斯湖李 · 2006-02-24 · via 博客园 - 尼斯湖李

    应AD部署的需要,编写了一段创建本地用户和加入用户到管理员组的脚本。脚本虽简单,但要保证正确执行还真麻烦,没有语法提醒,出现问题也莫名其妙。下面是我调试通过的代码,现公布出来供大家分享,以免调试之苦。

On Error Resume Next 
Dim strUserName,strPassword
Dim objDomain,objUser

Set objNetwork = CreateObject("Wscript.Network")
strComputer 
= objNetwork.ComputerName

strUserName 
= "clientadmin"
strPassword 
= "71999"

'创建用户
Set objDomain = GetObject("WinNT://" & strComputer & ",computer")
Set objUser = objDomain.Create("user",strUserName)
objUser.SetInfo 

'设置密码
Set objUser = GetObject("WinNT://" & strComputer & "/" & strUserName & ",user")
objUser.SetPassword strPassword
objUser.SetInfo 

'加入管理员组
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/" & strUserName & ",user")
objGroup.Add(objUser.ADsPath)

2006-02-24 by lig