最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
添加服务器操作员, from zdtips, in english
时间:2022-06-30 11:00:42 编辑:袖梨 来源:一聚教程网
                                            Adding Server Operators
Occasionally, you might want to add server operators for the FTP- or
WWW-server with ADSI. The VBScript below (which can also be translated to
ASP) shows an sample way of accomplishing this task.
'
' AddAdmin.vbs - Add an administrator to FTP, W3, NNTP or SMTP Service
'
' Usage: addadmin 
'
' Without changes the script must run on the local webserver.
' User in the form
'
Option Explicit
Dim iis
Dim acl
Dim sd
Dim ace
Dim acc
Dim arg
Dim net
Set arg = Wscript.Arguments
If arg.count < 1 Then
Wscript.Echo "Usage: addadmin
"
Wscript.Quit
End If
Set net = CreateObject("Wscript.Network")
Select Case Ucase(arg(0))
Case "FTP" Set iis = GetObject("IIS://" & net.computerName
& "/MSFTPSVC/1")
Case "W3" Set iis = GetObject("IIS://" & net.computerName
& "/W3SVC/1")
Case "NNTP" Set iis = GetObject("IIS://" & net.computerName
& "/NNTPSVC/1")
Case "SMTP" Set iis = GetObject("IIS://" & net.computerName
& "/SmtpSvc/1")
Case Else
Wscript.Echo "Usage: addadmin
"
Wscript.Quit
End Select
Set sd = iis.AdminACL
Set acl = sd.DiscretionaryAcl
If arg.Count = 2 Then
Set ace = CreateObject("AccessControlEntry")
ace.Trustee = arg(1)
ace.AccessMask = &HB
I did not find the real permissions (ACTRL_??? bits) description for
AccessMask, but I've copied it from a manual added entry. You can see the
bits running this script without specifying an user
acl.AddAce ace
iis.AdminAcl = sd
iis.SetInfo
Else
For Each ace In acl
Wscript.Echo ace.Trustee & " (0x" &
Hex(ace.AccessMask) & ")"
Next
End If
                                        				                
                    
                        
                            
                        
                   
                
            Occasionally, you might want to add server operators for the FTP- or
WWW-server with ADSI. The VBScript below (which can also be translated to
ASP) shows an sample way of accomplishing this task.
'
' AddAdmin.vbs - Add an administrator to FTP, W3, NNTP or SMTP Service
'
' Usage: addadmin
'
' Without changes the script must run on the local webserver.
' User in the form
'
Option Explicit
Dim iis
Dim acl
Dim sd
Dim ace
Dim acc
Dim arg
Dim net
Set arg = Wscript.Arguments
If arg.count < 1 Then
Wscript.Echo "Usage: addadmin
Wscript.Quit
End If
Set net = CreateObject("Wscript.Network")
Select Case Ucase(arg(0))
Case "FTP" Set iis = GetObject("IIS://" & net.computerName
& "/MSFTPSVC/1")
Case "W3" Set iis = GetObject("IIS://" & net.computerName
& "/W3SVC/1")
Case "NNTP" Set iis = GetObject("IIS://" & net.computerName
& "/NNTPSVC/1")
Case "SMTP" Set iis = GetObject("IIS://" & net.computerName
& "/SmtpSvc/1")
Case Else
Wscript.Echo "Usage: addadmin
Wscript.Quit
End Select
Set sd = iis.AdminACL
Set acl = sd.DiscretionaryAcl
If arg.Count = 2 Then
Set ace = CreateObject("AccessControlEntry")
ace.Trustee = arg(1)
ace.AccessMask = &HB
I did not find the real permissions (ACTRL_??? bits) description for
AccessMask, but I've copied it from a manual added entry. You can see the
bits running this script without specifying an user
acl.AddAce ace
iis.AdminAcl = sd
iis.SetInfo
Else
For Each ace In acl
Wscript.Echo ace.Trustee & " (0x" &
Hex(ace.AccessMask) & ")"
Next
End If
相关文章
- 星塔旅人强化机在哪 强化机位置一览 10-31
- 星塔旅人等级怎么突破 等级突破方法 10-31
- 辉烬知世怎么配队 知世配队攻略 10-31
- 口袋斗罗大陆独孤博技能是什么 独孤博技能介绍一览 10-31
- 王者万象棋香香怎么玩 香香玩法介绍 10-31
- 王者万象棋阵容怎么搭配 阵容搭配攻略 10-31
 
             
                                 
                                 
                                 
                                 
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                        