fasterthanyours
IS-IT--Management
The Environment is multiple XP/W7 machines running RemoteApp (RDP on steriods) to a 3 server TS cluster.
One of the issues with RemoteApp that I have found is that the login script, which I need to run, will sometimes call installation apps in the back ground and it will lock up the TS/RDP session and the users freak out.
Currently I built a script to install he Office 2007 Compatibility Pack on all of my XP Machines on the network. It works well, but I think I'd be better off if the script checks the local machine name and then exited if it was 1 of the TS Servers or the Data Server.
Basically as long as the local machine name isn't USGFDCDCDATA01, USGFDCDCTS01, USGFDCDCTS02, or USGFDCDCTS03 I want the script to run.
The global log in script runs this:
Which calls this file:
One of the issues with RemoteApp that I have found is that the login script, which I need to run, will sometimes call installation apps in the back ground and it will lock up the TS/RDP session and the users freak out.
Currently I built a script to install he Office 2007 Compatibility Pack on all of my XP Machines on the network. It works well, but I think I'd be better off if the script checks the local machine name and then exited if it was 1 of the TS Servers or the Data Server.
Basically as long as the local machine name isn't USGFDCDCDATA01, USGFDCDCTS01, USGFDCDCTS02, or USGFDCDCTS03 I want the script to run.
The global log in script runs this:
Code:
'------------------------------------------------------------------------------------
'Install MS Compatibility Pack for Office 2007
'------------------------------------------------------------------------------------
Set objShell = Wscript.CreateObject("WScript.Shell")
objShell.Run "\\cdc-dc1\NETLOGON\ExcelUpdate.vbs"
Set objShell = Nothing
Which calls this file:
Code:
'==========================================================================
'
' NAME: global.vbs
'
' AUTHOR: Mike Infinger
' UPDATED: 04/01/2010
'
' COMMENT: Enumerates current users' group memberships in given domain.
' Maps and disconnects drives.
'
'==========================================================================
ON ERROR RESUME NEXT
'Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path, HourNow, Greeting, GreetName, oVo, oRootDSE, oConnection, oCommand, oRecordSet, MyObj,
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
'------------------------------------------------------------------------------------
'Automatically grab the user's domain name
'------------------------------------------------------------------------------------
DomainString = Wshnetwork.UserDomain
'------------------------------------------------------------------------------------
'Find the Windows Directory
'------------------------------------------------------------------------------------
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
'------------------------------------------------------------------------------------
'Grab the user name
'------------------------------------------------------------------------------------
UserString = WSHNetwork.UserName
'------------------------------------------------------------------------------------
'Bind to the user object to get user name and check for group memberships later
'------------------------------------------------------------------------------------
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'------------------------------------------------------------------------------------
'Grab the computer name for use in add-on code later
'------------------------------------------------------------------------------------
strComputer = WSHNetwork.ComputerName
'------------------------------------------------------------------------------------
'Disconnect any drive mappings as needed.
' - In this script, Disconnects are perform based on Group Memberships.
' - This is only and example
'------------------------------------------------------------------------------------
'Example
'WSHNetwork.RemoveNetworkDrive "E:", True, True
'------------------------------------------------------------------------------------
'
' ****** WARNING ******
'
' *** DO NOT RUN THIS IN THE SCRIPT AS IT WILL DISCONNECT ALL MAPPINGS!!! ***
'
'Disconnect ALL mapped drives
'Set clDrives = WshNetwork.EnumNetworkDrives
'For i = 0 to clDrives.Count -1 Step 2
' WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, True
'Next
'------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------
'Give the PC time to do the disconnect, wait 2000 milliseconds
'------------------------------------------------------------------------------------
'WScript.sleep 200
'=====================================
'Add On Code goes above this line
'------------------------------------------------------------------------------------
'Installing Excel File Converter Program.
'Installs with only a progress bar.
'------------------------------------------------------------------------------------
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120000-0020-0409-0000-0000000FF1CE}"
strValueName = "DisplayName"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
MsgBox " Please be patient while we install a few updates.", "0", "** IMPORTANT MESSAGE FROM THE IT DEPARTMENT **"
Set MyObj=CreateObject("WScript.Shell")
'FileConverter Install
MsgBox " PLEASE CLICK RUN TO THE NEXT WINDOW.", "0", "** IMPORTANT MESSAGE FROM THE IT DEPARTMENT **"
MyObj.Run "\\rdu.carolinadoor.com\DFS_Data\Updates\FileFormatConverters.exe /quiet /passive"
Else
'Wscript.Echo "The registry key exists."
'MsgBox "Already Installed", "0", " ** IMPORTANT MESSAGE FROM THE IT DEPARTMENT **"
End If
'------------------------------------------------------------------------------------
'Complete
'------------------------------------------------------------------------------------