Home » Uncategorized » Page 2

Category: Uncategorized

SCRIPT: Folder exists on multiple servers

 Dim strFolder
        Dim arrServers
        Dim strProfile
        strProfile = “C$usersadministrator”
 arrComputers =     Array(“server1″,”server2”)
        Set objFSO = CreateObject(“Scripting.FileSystemObject”)
        sOutput=”Script Results for:” & strprofile & vbcrlf & vbcrlf       
        For EACH strComputer in arrComputers
        sOutput = sOutput & objFSO.FolderExists (“\”& strComputer & strProfile) & vbtab & strComputer & vbcrlf
        On Error Resume Next               
        Next
        wscript.echo sOutput

SCRIPT: File exists on multiple servers

 Dim strFolder
        Dim arrServers
        Dim strProfile
‘example of file path       
strProfile = “C$WindowsSysWOW64MacromedFlashflash10v.ocx”
 arrComputers =     Array(“server1″,”server2”)
        Set objFSO = CreateObject(“Scripting.FileSystemObject”)
        sOutput=”Script Results for:” & strprofile & vbcrlf & vbcrlf       
        For EACH strComputer in arrComputers
sOutput = sOutput & objFSO.FileExists (“\”& strComputer & strProfile) & vbtab & strComputer & vbcrlf
              On Error Resume Next               
        Next
        wscript.echo sOutput

SCRIPT: Check File Version on multiple Servers

 Dim strFolder
        Dim arrServers
        Dim strProfile
      strProfile = “C$WindowsSysWOW64MacromedFlashflash10v.ocx”
       arrComputers =     Array(“server1″,”server2”)
        Set objFSO = CreateObject(“Scripting.FileSystemObject”)
        sOutput=”Script Results for:” & strprofile & vbcrlf & vbcrlf       
        For EACH strComputer in arrComputers
 sOutput = sOutput & objFSO.GetFileVersion (“\”& strComputer & strProfile) & vbtab & strComputer & vbcrlf
        On Error Resume Next               
        Next
        wscript.echo sOutput

SCRIPT: add DNS Suffixes

‘vbscript Set Append DNS Suffixes (in order)
On Error Resume Next
strComputer = “.”
arrNewDNSSuffixSearchOrder = Array(“internal.domain.local.1”, “internal.domain.local.2”)
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\” & strComputer & “rootcimv2”)
Set objNetworkSettings = _
 objWMIService.Get(“Win32_NetworkAdapterConfiguration”)
intSetSuffixes = _
 objNetworkSettings.SetDNSSuffixSearchOrder(arrNewDNSSuffixSearchOrder)

Excel 2003 and Excel 2010 and default App-V file Associations

Problem: 1) all users to have excel 2003 as the default application (installed locally)
2) a specific group of users to have access to an APP-v’ed version of Excel 2010 (published to them via citrix PN Agent)
3) when the 2010 users double click a .xls file or a .xlsx then we wanted App-V Excel 2010 to be the default application.

Solution:
Our simple (though not necessarilty the best approach) was to have a logon script run for the Excel 2010 users which ran the following commands

assoc .xls=Excel2010
assoc .xlsx=Excel2010
ftype Excel2010=sfttray.exe /launch “Excel2010” %1 %*

we also needed to ensure that NO file associations for 2010 were assigned in the APP-V package (otherwse 2010 was taking over for all users of the server it was installed on)

we also needed to check that there were no user specific reg keys for file associations in the users HKCUSOFTWAREclassses