关于:Win2003 Terminal Service(4)- IE 定制界面

通过 (1)-(3) 设置,Terminal Users 桌面就变成了一片空白,很多功能组件如我的电脑、控制面板等不仅不能进入,而且连图标也找不到了。

使用以下启动脚本,以强化 Terminal Users 桌面:

1)当用户在客户端登录时,会自动打开一个 IE 程序,IE 程序默认主页是 TS WEB ACCESS 网页;

2)用户在网页上出现指定的程序,客户直接使用就行了;

3)如果用户把 IE 关了,系统会自动打开一个新的 IE 程序。

=======================================================================
LogonIE.vbs
=======================================================================

On Error Resume Next
Set WshShell = WScript.CreateObject ("WScript.Shell")
 
'Get the username and profile directory
MUser = WshShell.ExpandEnvironmentStrings ("%USERNAME%")
 
'Run the app
Itrue = True
Do until Itrue = false
wshShell.Run "iexplore.exe"
 
' Connect to wmi
set objWMIService = GetObject("winmgmts:root\cimv2")
Do
    found = false
' List the processes
strQuery = "Select * from win32_process where name='iexplore.exe'"
set colProcesses = objWMIService.ExecQuery(strQuery)
 
for each proc in colProcesses
 
     ' Get the reference class linking processes to sessions to get the session object path
     strQuery = "References of {win32_process.handle='" & proc.handle & "'} where ResultClass=Win32_SessionProcess"
     set colSessionReferences = objWMIService.ExecQuery(strQuery)
 
     for each oSessionReference in colSessionReferences
            'Get associators of the session object that are user accounts (linked by win32_loggedonuser)
            strQuery = "Associators of {" & oSessionReference.antecedent & "} where AssocClass=win32_LoggedOnUser"
            set colUsers = objWMIService.ExecQuery(strQuery,,48)
                for each user in colUsers
                 if user.name = MUser then found = true
                 Itrue = True
            next
     next
next
Loop While found = true
Loop

=======================================================================

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生活在香樟园里

你的鼓励是我前进的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值