网络访谈之拉开优质格局,域碰着新闻探测的vbs

作者:黑妖蛇
注:其实那是 依据ADSI(Active Directory Services
Interface:活动目录服务接口卡塔尔写的顺序。假诺

不知晓大家是还是不是遇到过访问某些计算机弹出黑古铜色黑河客户同一时候不可更换的弹窗,而自XP以上平凉顾客又是剥夺状态,那样就产生不能访谈那台微处理器的能源。

原创小说:款待转发,转发时请保留作者名及出处
作者:jacksonluo
生机勃勃:IIS的服务器早先时期配置(别的的随州就不提了) (以 freeshare.com.cn为例
)
1.创制该域的(freeshare.com.cn)Computer顾客名,并安装一个平安密码
2.创设该域的目录文件夹如(D:\Inetpub\freeshare.com.cn)
3.安装目录访问权限,freeshare.com.cn对该目录完全调节(提供无名氏客户访谈该网址)
4.成立三个该域名的描述(公司名)
的独立接收进程池,为每二个设想主机制造独立的应用程序进程池,保分别网址的主题材料不会影响整台服务器的运作。创立进程池时能够独立设定用户名和密码并设置CPU,连接数等。这里运用的是暗中认可的。
威尼斯赌场 ,5.创造二个设想主机,并选拔方面所创办的利用进程池,在目录安全性中采用无名客商freeshare.com.cn,并安装与Computer创设freeshare.com.cn顾客名的密码意气风发致,必需生机勃勃致,不然不能访谈该网址。
OK,那一个就对各样虚构主机要做的,那么这么些是还是不是索要全方位的人工的去完毕吗?答案是不是定的,WINDOWS下也足以兑现脚本编程哦,(呵呵我原来也是不知晓的)
这正是说即然能够不用去手工业完毕,用哪些吧?用VBSCRAV4IPT脚本吧。
二:用脚本实现上述创立设想主机的动作
保存为createsiglewebsite.vbs

teN.potgnayiaH.wwW vbs小铺

您安装了resource
kit,这段代码能够用netcom那条命令举办专门的工作,下边是netcom的三个例子:NETDOM

650) this.width=650;” border=0>

复制代码 代码如下:

原先代码在
,缺憾它的要调用excel组件,何况还有大概会弹出ie对话框。花了几许时日改正了眨眼之间间,能够直接保存成html了,方便用于入侵。。由于小编用的是数组pc(65535,10),若是内网过大(>65535?,呵呵卡塔尔国请小心使用,只测验过域管理员权限,别的权限未测,应当也是能够的。

/Domain:MYDOMAIN /user:adminuser /password:apassword MEMBER MYCOMPUTER
/ADD

 

Dim SiteNum,IPAddr,PortNum,LenComputer,WebServerComment,LogDirectory
Dim user_password,GroupName,tmpFolder,UserNameComp,WebServerAutoStart
Dim WebAnonymousUserName
WebServerComment=”集团名”‘网址描述、计算机客户描述及全名接受这几个变量
UserNameComp=”freeshare.com.cn”‘Computer客商名及客户目录选择那一个变量
HostName = “:80:www.freeshare.com.cn”‘虚构主机站点主机名
WebAnonymousUserName =
getComputer()&”\”&UserNameComp’设想主机无名氏顾客(后面加了地方Computer名)
user_password = “**********”‘Computer顾客和佚名客户密码。
GroupName = “Guests”‘Computer客商所在的组
IPAddr = “”‘ComputerIP地址,可感到空
tmpFolder = “D:\inetpub\”&UserNameComp’目标目录
LenComputer = Len(getComputer())+1’Computer名+’\’的长度
PortNum = “80”‘设想主机端口
WebServerAutoStart = “true”‘制造虚构主机后是或不是运转true和false
LogDirectory = “”‘日志目录
‘检验是不是留存该客商的计算机帐号
If Not checkUser(UserNameComp) Then
‘添加该Computer客户帐号
AddUser
getComputer(),UserNameComp,user_password,WebServerComment,WebServerComment,GroupName
Else
Wscript.echo “该Computer客商名也存在…………..”
End If
‘创立客商主目录
CreateFileDirectory(tmpFolder)
‘修改顾客主目录的访问权限
SetNTFSDirectoryPerssion(UserNameComp)
‘成立应用进度池
createAppPool WebServerComment
‘创设设想主机站点
CreateWebSite
getComputer(),IPAddr,HostName,tmpFolder,LogDirectory,WebServerComment,UserNameComp,user_password,WebServerAutoStart
‘BuildNum = BuildNum+1
‘Wscript.echo
“==============================================”&BuildNum&”=============================================”
‘为各类IIS虚构主机应用程序站点创制站点应用程序池
Function createAppPool(strName)
On Error Resume Next
Err.Clear
Set ObjAppPoolsExist =
GetObject(“IIS://”&getComputer()&”/W3SVC/AppPools”&strName)
If Err.number = 0 Then
wscript.echo “该采用进程池已开立………….”
Set ObjAppPoolsExist = Nothing
Exit Function
Else
Set objAppPools = GetObject(“IIS://” & getComputer() &
“/W3SVC/AppPools”)
Err.Clear
Set objAppPool = objAppPools.Create(“IIsApplicationPool”, strName)
If err.number = 0 Then
objAppPool.AppPoolIdentityType = 2 ‘runs as NT AUTHORITY\NETWORK 3 Run
as specific user account 1 runs as NT AUTHORITY\LOCAL SERVICE 0 runs as
NT AUTHORITY\SYSTEM
objAppPool.SetInfo
If err.Number = 0 Then
createAppPool = true
Wscript.echo”应用程序”&strName&”成立成功!”
Else
createAppPool = false
Wscript.echo”应用程序”&strName&”成立失利!”
End If
Else
createAppPool = false
End If
End If
Set objAppPool = Nothing
Set objAppPools = Nothing
Set ObjAppPoolsExist = Nothing
End Function
Function
CreateWebSite(strComputer,IPAddr,WebServerBingings,WebSiteDirectory,LogDirectory,WebSiteInfo,GuestUserName,GuestUserPass,StartOrStop)
Dim w3svc, WebServer, NewWebServer, NewDir
Dim Bindings, BindingString, NewBindings, SiteNum, SiteObj, bDone
On Error Resume Next
Err.Clear
‘检查测量试验是或不是可以加载W3SVC服务(即WEB服务卡塔 尔(阿拉伯语:قطر‎
Set w3svc = GetObject(“IIS://” & getComputer() & “/w3svc”)
If Err.Number <> 0 Then ‘呈现错误提醒
Wscript.echo “无法张开: “&”IIS://” & getComputer() & “/w3svc”
Exit Function
End If
‘检查评定是不是有设定相近IP地址、端口及主机名的站点存在
BindingString = IPAddr & WebServerBingings
For Each WebServer in w3svc
If WebServer.Class = “IIsWebServer” Then
Bindings = WebServer.ServerBindings
If BindingString = Bindings(0) Then
Wscript.echo “虚构主机:” & HostName & “,已存在,不恐怕创制……!.”
Exit Function
End If
End If
Next
‘显著叁个不设有的站点编号做为新建站点编号,系统暗许WebSite站点编号为1,由此从2从头
SiteNum=2
bDone = False
While (Not bDone)
Err.Clear
Set SiteObj = GetObject(“IIS://”&getComputer()&”/w3svc/”&SiteNum)
‘加载钦赐站点
If (Err.Number = 0) Then
‘Wscript.echo ” Step_1站点”&SiteNum&”存在”
SiteNum = SiteNum + 1
Else
‘Wscript.echo ” Step_1站点”&SiteNum&”不存在”
Err.Clear
Set NewWebServer = w3svc.Create(“IIsWebServer”,SiteNum) ‘创立钦定站点
If (Err.Number <> 0) Then
Wscript.echo SiteNum&”创制退步”
SiteNum = SiteNum + 1
Else
Wscript.echo SiteNum&”创立成功”
bDone = True
End If
End If
If (SiteNum > 1000) Then ‘服务器最大创立站点数
Wscript.echo “超过服务器最大创制站点数,正在创立的站点的序号为:
“&SiteNum&”.”
Exit Function
End If
Wend
‘实行站点为主配置
NewBindings = Array(0)
NewBindings(0) = BindingString
NewWebServer.ServerBindings = NewBindings
NewWebServer.ServerComment= WebServerComment
NewWebServer.AnonymousUserName= GuestUserName
NewWebServer.AnonymousUserPass= GuestUserPass
NewWebServer.KeyType = “IIsWebServer”
NewWebServer.FrontPageWeb = True
NewWebServer.EnableDefaultDoc = True
NewWebServer.DefaultDoc = “Default.htm, Default.asp, Index.htm,
Index.asp,index.html,default.html”
NewWebServer.LogFileDirectory= LogDirectory
NewWebServer.SetInfo
Set NewDir = NewWebServer.Create(“IIsWebVirtualDir”, “ROOT”)
NewDir.Path = WebSiteDirectory
NewDir.AccessRead = true
NewDir.AppFriendlyName = WebServerComment
NewDir.AppCreate True
NewDir.AccessScript = True
NewDir.AuthNTLM = True
NewDir.AppIsolated = “2”
NewDir.AppPoolId = WebServerComment
‘NewDir.AppCreate3 2,WebSiteInfo,false
NewDir.AuthFlags = “AuthAnonymous | AuthNTLM” ‘集成windows身份验证
Err.Clear
NewDir.SetInfo
If (Err.Number <> 0) Then
Wscript.echo “主目录成立时出错.”
Exit Function
End If
If StartOrStop = True Then
Err.Clear
Set NewWebServer = GetObject(“IIS://” & getComputer() & “/w3svc/” &
SiteNum)
网络访谈之拉开优质格局,域碰着新闻探测的vbs。NewWebServer.Start
If Err.Number <> 0 Then
Wscript.echo “运营站点时出错!”
Err.Clear
End If
End If
Wscript.echo “站点成立成功,站点编号为:”& SiteNum &” ,域名称为:”&
WebServerBingings
‘SetCPULimitVar strComputer,SiteNum,100 ‘调用CPU最大应用程度
End Function
Function getComputer()
Dim objNet
Set objNet = CreateObject(“WScript.Network”)
getComputer= objNet.ComputerName
Set objNet = Nothing
End Function
Function CreateFileDirectory(UserName)
Set FsObject = CreateObject(“Scripting.FileSystemObject”)
On Error Resume Next
Err.Clear
If Not FsObject.FolderExists(UserName) Then
FsObject.CreateFolder(UserName)
If Err.number<>0 Then
Wscript.echo “创立目录” & UserName & “战败!”
Else
Wscript.echo “创造目录” & UserName & “成功!”
END if
Else
Wscript.echo”目录” & UserName & “已存在,您不可能创造!”
End if
Set FsObject = Nothing
End Function
Function SetNTFSDirectoryPerssion(sourceDirectory)
Dim WshShell,oExec
Dim exeDirectory
exeDirectory = “C:\Program Files\Resource Kit\xcacls.exe
C:\Inetpub\”
Orders_exec = exeDirectory&sourceDirectory&” /E /T /G
“&sourceDirectory&”:F;F”
Set WshShell = CreateObject(“WScript.Shell”)
Set oExec = WshShell.Exec(Orders_exec)
If oExec.status = 0 Then
Wscript.echo ” 命令成功实行!”
Else
Wscript.echo ” 命令试行倒闭!权限非常不足可能该程序不可能在DOS状态下运作”
End If
Set WshShell= Nothing
End Function
Function checkUSer(strUser)
On Error Resume Next
‘Check if domain is already part of username passed to function
If instr(strUser,”\”) = 0 then
Set objGrp = GetObject(“WinNT://” & getComputer() & “/” & strUser &
“,user”)
Else
Set objGrp = GetObject(“WinNT://” & replace(strUser,”\”,”/”) &
“,user”)
End If
If err.number = 0 Then
checkUSer = true
Else
checkUSer = false
End If
Set objGrp = Nothing
On Error Goto 0
End Function
Function AddUser(Computer,UserName,PassWord,FullName,Info,GroupName)
DIM intReturn,FsObject
On Error Resume Next
‘试行成立帐号命令
Set ComputerAccoutObj =
GetObject(“WinNT://”&getComputer()&”/”&UserName&”,user”)
if Err.number=0 then
Wscript.echo UserName&”Computer顾客已存在….”
Else
Set ComputerObj = GetObject(“WinNT://”&getComputer())
Set NewUser = ComputerObj.Create( “User” , UserName )
NewUser.SetInfo
‘进行帐号设置
NewUser.SetPassword ( PassWord ) ‘帐号密码
NewUser.FullName = FullName ‘帐号全名
NewUser.Description = Info ‘帐号表明
NewUser.UserFlags = &H10000 xor &H0040
‘&H二〇〇〇0(使用者下一次登陆时须改良密码) &H0040(使用者不得改换密码)
&H10000(密码恒久精确) &H0002(帐户一时半刻停用)
NewUser.SetInfo
Wscript.echo “帐号”&UserName&”创建成功!”
Set objSeLectGroup = GetObject(“WinNT://” & getComputer() &
“/Guests,group”)
Set objAddUser = GetObject(“WinNT://” & getComputer() & “/” & UserName
&”,user”)
objSeLectGroup.Add(objAddUser.ADsPath)
End if
Set ComputerObj=nothing
Set ComputerAccoutObj = nothing
Set ComputerAccoutGroupObj = nothing
End Function

Inventory2.vbs
code by
; modify by lcx
Option Explicit
Dim strComputer, strDN
Dim objShell, objFSO, strTemp, strTempFile, fileS
Dim objRootDSE, strRootDomain, adoConnection, adoCommand, strQuery
Dim adoRecordset, strAttributes
Dim objRemote, strRole
Dim strExcelPath, intRow, pc(65535,10)
Dim colSettings, objOS, objComputer
Dim objFix
Dim blnFlag, strPrevious, strStatus
Dim sHTML

***********************
* Start Script
***********************
Dim sComputerName, sUserOrGroup, sPath, computerContainer, rootDSE,
lFlag
Dim secDescriptor, dACL, ACE, oComputer, sPwd

威尼斯赌场 1

程序完,你生龙活虎旦把上边的程序保存在以 *.vbs
windows目录下,就足以一直实行了,

Const ADS_CHASE_REFERRALS_SUBORDINATE = &H20
If (Wscript.Arguments.Count <> 1) Then
    Wscript.Echo “Argument <FileName> required. For example” &
vbCrLf _
        & “cscript Inventory.vbs “”c:MyFolderInventory.html”””
    Wscript.Quit
End If

*********************************************************************
* Declare constants used in defining the default location for the
* machine account, flags to identify the object as a machine account,
* and security flags
*********************************************************************

减轻格局:

下边用到了三个xcacls的改造NTFS权限的小程序,您能够从微软官网下载,你也能够访问下载安装既可。
其它一些见IIS服务器备份转移技术方案(二)

Spreadsheet file name to be created.
strExcelPath = Wscript.Arguments(0)
blnFlag = True
Set objShell = CreateObject(“Wscript.Shell”)
On Error Resume Next
Set objRootDSE = GetObject(“LDAP://RootDSE”)
If (Err.Number <> 0) Then
    On Error GoTo 0
    Set objShell = Nothing
    Wscript.Echo “Domain not found, program aborted.”
    Wscript.Echo “You may not be logged into a domain.”
    Wscript.Quit
End If
On Error GoTo 0
strRootDomain = objRootDSE.Get(“rootDomainNamingContext”)
pc(0,0) = “sAMAccountName”
pc(0,1)=”distinguishedName”
pc(0,2)=”WMI”
pc(0,3)=”# of OSs”
pc(0,4)= “OS Caption”
pc(0,5)=”OS Version”
pc(0,6)= “OS Service Pack”
pc(0,7)= “# of Hot Fixes”
pc(0,8)= “Hot Fix ID”
pc(0,9)= “# of Computer Systems”
pc(0,10)=”Computer Role”
sHTML = “<table width=100% border=1 cellspacing=0 cellpadding=0>”

Const UF_WORKSTATION_TRUST_ACCOUNT = &H1000
Const UF_ACCOUNTDISABLE = &H2
Const UF_PASSWD_NOTREQD = &H20
Const ADS_GUID_COMPUTRS_CONTAINER =
“aa312825768811d1aded00c04fd8d5cd”
Const ADS_ACETYPE_ACCESS_ALLOWED = 0
Const ADS_ACEFLAG_INHERIT_ACE = 2

意气风发,启用拉萨账号(不引进卡塔 尔(阿拉伯语:قطر‎,再重设密码,以此密码访问。

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set fileS=objFSO.opentextfile(strExcelPath,2,true)
fileS.writeline sHTML&vbcrlf&
“<tr><td>”&pc(0,0)&”</td><td>”&pc(0,1)&”</td><td>”&pc(0,2)&”</td><td>”&pc(0,3)_
&”</td><td>”&pc(0,4)&”</td><td>”&pc(0,5)&”</td><td>”&pc(0,6)&”</td><td>”&pc(0,7)_
&”</td><td>”&pc(0,8)&”</td><td>”&pc(0,9)&”</td><td>”&pc(0,10)&”</td></tr>”

*********************************************************************
* Set the flags on this object to identify it as a machine account
* and determine the name. The name is used statically here, but may
* be determined by a command line parameter or by using an InputBox
*********************************************************************

二,步入组战略编辑器(gpedit.msc卡塔 尔(英语:State of Qatar),依次张开Computer配置——windows
设置——安全设置——本地战术——安全选项,在左边手找到“互连网访谈:当地账户的达州和共享方式,将阜新改成杰出,那样就能够输入顾客名和密码登入了。

Use ADO to search Active Directory for all computers.
Set adoCommand = CreateObject(“ADODB.Command”)
Set adoConnection = CreateObject(“ADODB.Connection”)
adoConnection.Provider = “ADsDSOObject”
adoConnection.Open = “Active Directory Provider”
adoCommand.ActiveConnection = adoConnection

lFlag = UF_WORKSTATION_TRUST_ACCOUNT Or UF_ACCOUNTDISABLE Or
UF_PASSWD_NOTREQD
sComputerName = “TestAccount”

威尼斯赌场 2

Retrieve attributes.
strAttributes = “sAMAccountName,distinguishedName”
strQuery = “<LDAP://” & strRootDomain _
    & “>;(ObjectCategory=computer);” & strAttributes & “;subtree”

*********************************************************************
* Establish a path to the container in the Active Directory where
* the machine account will be created. In this example, this will
* automatically locate a domain controller for the domain, read the
* domain name, and bind to the default “Computers” container
*********************************************************************

650) this.width=650;” border=0>

adoCommand.CommandText = strQuery
adoCommand.Properties(“Page Size”) = 100
adoCommand.Properties(“Timeout”) = 30
adoCommand.Properties(“Cache Results”) = False
adoCommand.Properties(“Chase Referrals”) = _
    ADS_CHASE_REFERRALS_SUBORDINATE

Set rootDSE = GetObject(“LDAP://RootDSE”)
sPath = “LDAP://oComputer.Put “samAccountName”, sComputerName + “$”
oComputer.Put “userAccountControl”, lFlag
oComputer.SetInfo

 

Set adoRecordset = adoCommand.Execute
Specify temporary file to save ping results.
strTemp = objShell.ExpandEnvironmentStrings(“%TEMP%”)
strTempFile = strTemp & “RunResult.tmp”

*********************************************************************
* Establish a default password for the machine account
*********************************************************************

 

Enumerate computer objects.
intRow = 2
Do Until adoRecordset.EOF
    strComputer = adoRecordset.Fields(“sAMAccountName”).Value
    Remove trailing “$”.
    strComputer = Left(strComputer, Len(strComputer) – 1)
    pc(intRow, 0)=strComputer
    strDN = adoRecordset.Fields(“distinguishedName”).Value
    pc(intRow, 1)=strDN
strPrevious = strComputer

sPwd = sComputerName & “$”
sPwd = LCase(sPwd)
oComputer.SetPassword sPwd

只要只是上边的操作自个儿想已经不是何许技能了,地球人都知情!这里将应用另类方法针对那三个懒人大概生手双击就能够缓慢解决难点。

If (blnFlag = False) Then
         If (Err.Number <> 0) Then
            On Error GoTo 0
            Wscript.Echo “The path may be invalid.”
            strExcelPath = “”
        End If
        On Error GoTo 0
        adoRecordset.Close
        adoConnection.Close
        If (objFSO.FileExists(strTempfile) = True) Then
            objFSO.DeleteFile(strTempFile)
        End If
        Set objRootDSE = Nothing
        Set adoCommand = Nothing
        Set adoConnection = Nothing
        Set adoRecordset = Nothing
        Set objRemote = Nothing
        Set objShell = Nothing
        Wscript.Echo “Program Aborted”
        Wscript.Echo “Computers documented: ” & (intRow – 1)
        If (strExcelPath <> “”) Then
            Wscript.Echo “See spreadsheet ” & strExcelPath
        End If
        Wscript.Quit
    End If

*********************************************************************
* Specify which user or group may activate/join this computer to the
* domain. In this example, “MYDOMAIN” is the domain name and
* “JoeSmith” is the account being given the permission. Note that
* this is the downlevel naming convention used in this example.
*********************************************************************

1.以下脚本将开启杰出形式(即能够输入客户名和密码卡塔 尔(阿拉伯语:قطر‎,复制代码为“开启杰出方式.vbs”

    Ping computer to see if online.
    If (IsConnectible(strComputer, 1, 750) = True) Then
        Connect to computer with WMI.
        On Error Resume Next
        Set objRemote = GetObject(“winmgmts:” _
            & “{impersonationLevel=impersonate}!\” _
            & strComputer & “ootcimv2”)
        If (Err.Number <> 0) Then
            On Error GoTo 0
           
    pc(intRow, 2)=”WMI Not Installed”
            strStatus = ” no WMI”
        Else
            On Error GoTo 0
            pc(intRow, 2)=”WMI Installed”
            On Error Resume Next
            Set colSettings = objRemote.ExecQuery _
    &

sUserOrGroup = “MYDOMAINjoesmith”

On Error Resume Next

vbs小铺 原本代码在

,缺憾它的要调用excel组件,并且还有可能会弹出ie对话框。花了好什么日期间…

*********************************************************************
* Bind to the Discretionary ACL on the newly created computer account
* and create an Access Control Entry (ACE) that gives the specified
* user or group full control on the machine account
*********************************************************************

Const HKEY_LOCAL_MACHINE = &H80000002

Set secDescriptor = oComputer.Get(“ntSecurityDescriptor”)
Set dACL = secDescriptor.DiscretionaryAcl
Set ACE = CreateObject(“AccessControlEntry”)

strComputer = “.”

*********************************************************************
* An AccessMask of “-1” grants Full Control
*********************************************************************

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &

    strComputer & “\root\default:StdRegProv”)

ACE.AccessMask = -1
ACE.AceType = ADS_ACETYPE_ACCESS_ALLOWED
ACE.AceFlags = ADS_ACEFLAG_INHERIT_ACE

strKeyPath = “SYSTEM\CurrentControlSet\Control\Lsa”

*********************************************************************
* Grant this control to the user or group specified earlier.
*********************************************************************

strValueName = “forceguest”
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

ACE.Trustee = sUserOrGroup

 

*********************************************************************
* Now, add this ACE to the DACL on the machine account
*********************************************************************

2.以下脚本将关外阴痛典格局,开启白山情势,复制代码为“开启本溪格局.vbs”

dACL.AddAce ACE
secDescriptor.DiscretionaryAcl = dACL

On Error Resume Next

*********************************************************************
* Commit (write) the security changes to the machine account
*********************************************************************

Const HKEY_LOCAL_MACHINE = &H80000002

oComputer.Put “ntSecurityDescriptor”, Array(secDescriptor)
oComputer.SetInfo

strComputer = “.”

*********************************************************************
* Once all parameters and permissions have been set, enable the
* account.
*********************************************************************

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &

    strComputer & “\root\default:StdRegProv”)

oComputer.AccountDisabled = False
oComputer.SetInfo

strKeyPath = “SYSTEM\CurrentControlSet\Control\Lsa”

*********************************************************************
* Create an Access Control Entry (ACE) that gives the specified user
* or group full control on the machine account
*********************************************************************

strValueName = “forceguest”
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

wscript.echo “The command completed successfully.”

 

*****************
* End Script
*****************
是因为超级多管制范围,恐怕不能直接使用Windows的explorer
shell,须求在命令涨势势下对长间隔Computer进

 

行操作。而下令行下所支撑的下令远不可能满意大家的供给,除了Windows
XP扶助用shutdown命令重启、关

说起底,表达下消除方式的笔触,组战术是注册表的一小部分,只要找到呼应的键值就可以消除此难点,用有个别注册表监控工具监察和控制注册表前后所做的动作轻巧寻找该键值

闭或吊销当前Computer之外,别的的Windows平台均未将相像意义作为中央命令。“Windows
管理专门的职业”

(WMI) 脚本系统(如 Windows 主机脚本卡塔尔国的 WMI
能够用来寻觅大大多计算机连串方面包车型客车布局详细音讯(

概括服务器应用卡塔尔,也许做出能够影响到系统的改换。其实WMI大家并不生分,有多少个管理工科具正是启用

WMI的,譬如“系统质量”、“系统新闻”和“服务”的“依存关系”组件。

1.重启远程可能地面Computer

打开放肆文本编辑器,(建议用UltraEdit,因为能够自动安装剧情的明确性提示类型,关键字会加亮

来得)键入以下内容:
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate,(Shutdown)}!\” & strComputer &
“ootcimv2”)
Set colOperatingSystems = objWMIService.ExecQuery _
(“Select * from Win32_OperatingSystem”)
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next
另存为.VBS文件,举例reboot.vbs,放入systemrootsystem32下(systemroot是指Windows的设置目录卡塔尔国

,在命令行输入reboot就能够自行推行该脚本。之所以放在systemroot下是因为Windows默许设置的连串环

境变量在那文件夹。必要验证的是str计算机那个变量:假使那几个本子要在长途Computer上实行,则变量

剧情”.”修正成远程Computer名。比如我们要在LAN内机器名字为Server的Computer上履行那些本子,那么变量名

相应改善成str计算机 = “Server”。前提是早已赢得Server上的对应权限。

2.关闭本地Computer

XP的shutdown命令要求设置有个别参数才干精确实践,远不比在命令行下施行VBS脚本方便。雷同在文

本编辑器中键入以下内容:
Set colOperatingSystems =
GetObject(“winmgmts:{(Shutdown)}”).ExecQuery(“Select * from

Win32_OperatingSystem”)
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next
另存为.VBS文件,假诺在XP下就绝不存成和shutdown同名了。实践后能够火速关闭计算机。

提醒:关于Windows脚本宿主的进级换代。假如当前采取的是 Windows 二零零一 或
Windows ME,则Computer系

统中安装的是 2.0 版的 WSH。固然运转的是 Windows 95、98 或 Windows NT
4.0,则设置的是 1.0 版

。若要进级到 WSH 5.6,请访谈 Microsoft Windows 脚本技能 Web
站点,网站为:

(

注:其实那是 依据ADSI(Active
Directory Services Interface:活动目录服务接口卡塔尔写的次序。假如你安装了resource kit,这段代码能够用…

admin

网站地图xml地图