Jump to content

AlexB

Members
  • Posts

    565
  • Joined

Everything posted by AlexB

  1. Tesco vouchers have the older Eye-Fi Share and I was thinking of getting one to play with...
  2. Is the server gone, or am I searching wrong? nm, guess it's case sensitive
  3. +1 for harmony... never going back
  4. My experience with ebuyer... Very poor delivery Often faulty products grim customer support But with usually the cheapest prices around I accept this and keep ordering from them.
  5. Like Chris_Cook, we block book the areas we don't want booked. With the repeat function and the multi room selection this is often a single booking to block out the lot.
  6. Assuming your staff are in a separate OU and the pupils are not a sub OU of the staff OU you can use the built in variable array $ldap_base_dn[] For example ours is set like this:- $ldap_base_dn[] = "ou=xxx_staff,ou=xxx_school,ou=Schools,dc=xxx,dc=xxx,dc=internal"; $ldap_base_dn[] = "ou=xxx_technicians,ou=xxx_school,ou=Schools,dc=xxx,dc=xxx,dc=internal";
  7. I believe cscript is the correct way to call vb scripts. You might also want to take a look at another very similar post. The tidy up script is a lot more fleshed out than the one above I wrote quickly at home the other day, but it does look rather similar
  8. Have you got anything at http://wpad.domain.nextlevel.etc/wpad.dat or http://wpad.nextlevel.etc/wpad.at ... and so on. If you have "automatically detect settings" ticked (is by default) I have found at another school I'm seconded to that because we are all part of a central forest that another level up above the schools there is a wpad server with a wpad.dat file hosted that, on occasions, provides proxy configuration that we don't want, because of that tick box.
  9. No, I have no dead shortcuts Most likely the all users startmenu... but why would you allow users to install software?
  10. It would work best when run after the batch file.
  11. edited:*Please read the instructions about this thread and do not post about salaries etc. Only information about the position*
  12. Bah, what can I say, the idea intrigued me! Anyway, this script will parse through the location defined in objStartFolder and look for any shortcuts pointing to locations beginning with sTargetStart and if they don't point to anything valid it deletes them. Afterwards it goes through and looks for empty folders and removes them too. As it is set atm it looks in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Applications" (After first checking it exists) for any shortcuts (.lnk) that point to a target starting with "C:\" and removes it if the target doesn't exist. I've hacked this together quite quickly, so don't expect anything pretty Set objFSO = CreateObject("Scripting.FileSystemObject") Set oShell = CreateObject("WScript.Shell") objStartFolder = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Applications" sTargetStart = "C:\" If objFSO.FolderExists(objStartFolder) Then ' Check for invalid shortcuts pointing to locations starting with sTargetStart Set objFolder = objFSO.GetFolder(objStartFolder) Set colFiles = objFolder.Files For Each objFile in colFiles CheckValid objFile Next CheckSubFoldersShortcuts objFSO.GetFolder(objStartFolder) ' Check for empty folders after clearing out invalid shortcuts CheckSubFoldersEmptyAndRemove objFSO.GetFolder(objStartFolder) Else 'msgbox objStartFolder & " does not exist" End If Sub CheckSubFoldersEmptyAndRemove(Folder) For Each Subfolder in Folder.SubFolders Set objFolder = objFSO.GetFolder(Subfolder.Path) If FolderEmpty(Subfolder.Path) Then 'msgbox "delete " & Subfolder.Path objFSO.DeleteFolder Subfolder.Path Else 'msgbox Subfolder.Path & " is occupied" CheckSubFoldersEmptyAndRemove Subfolder End If Next End Sub Sub CheckSubFoldersShortcuts(Folder) For Each Subfolder in Folder.SubFolders Set objFolder = objFSO.GetFolder(Subfolder.Path) Set colFiles = objFolder.Files For Each objFile in colFiles CheckValid objFile Next CheckSubFoldersShortcuts Subfolder Next End Sub Sub CheckValid(objCheckFile) If LCase(objFSO.GetExtensionName(objCheckFile.name)) = "lnk" Then Set oLnk = oShell.CreateShortcut(objCheckFile.path) 'msgbox objCheckFile.Path 'msgbox oLnk.TargetPath If StrComp(LCase(Left(oLnk.TargetPath,Len(sTargetStart))),LCase(sTargetStart)) = 0 Then If objFSO.FileExists(oLnk.TargetPath) Then 'msgbox objCheckFile.path & " is a valid shortcut" Else 'msgbox objCheckFile.path & " is an invalid shortcut" objFSO.DeleteFile objCheckFile.path End If Else 'msgbox "Not local shortcut" End If End If End Sub Function FolderEmpty(strFolderPathName) Dim oFiles, oFile, oFolder, oSubFolders, oSubFolder Dim blnFileFound : blnFileFound = False Set oFolder = objFSO.GetFolder(strFolderPathName) Set oFiles = oFolder.Files If oFiles.Count > 1 Then FolderEmpty = False Exit Function ElseIf oFiles.Count = 1 Then For Each oFile In oFiles If oFile.Name <> "desktop.ini" Then FolderEmpty = False Exit Function End If Next End If Set oSubFolders = oFolder.SubFolders For Each oSubFolder In oSubFolders If Not FolderEmpty(oSubFolder.Path) Then FolderEmpty = False Exit Function End If Next FolderEmpty = True End Function I know my original script was batch, but I didn't think I could do this with batch, so vbs will have to do
  13. Hi FN, Yes it would copy dead shortcuts if there were any due to the previously mentioned network shortcuts. I could have 2 systems, one of network based programs and one for locally installed programs, but I haven't the need. I am wondering about a script at the end that could check through shortcuts and remove dead ones if they point to local locations that don't exist. I like the thought I might dedicate some time to it, but I have no idea if it is possible and I have my job appeal tomorrow, so it could be a while...
  14. Hi kholler Glad you found a solution. I'd recommend bookmarking Edugeek, there are lots of people here with vast knowledge between them, I rarely find they can't help me
  15. Sorry, but no, that wouldn't work in our environment as many of the shortcuts point to mapped network drives that the local machine wouldn't see, so testing validity would cause these to drop out too.
  16. I think I came up with something similar to what you are talking about... I have 2 (3 if you include the staff only version) parts to this. A folder in the All Users start menu called applications that is linked to the user's start menu at login if it doesn't already exist (first login) using linkd A machine batch script that runs at boot to check 2 locations, one for creation and one for removal (A folder in the All Users start menu call staff) The batch script has 3 variables at the top that need to be set. cutpath is the location where the current shortcuts are oldcutpath is where you MOVE shortcuts to after they are no longer needed cutbase is where the script copies the shortcuts to on the local machine. @echo off set cutpath=\\\NETLOGON\Shortcuts set oldcutpath=\\\NETLOGON\OldShortcuts set cutbase=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Applications for /d /r %cutpath% %%i IN (*) do (call :makefolders "%%i") FOR /R %cutpath% %%i IN (*.lnk) DO (call :copycuts "%%i") FOR /R %oldcutpath% %%i IN (*.lnk) DO (call :removecuts "%%i") FOR /R %oldcutpath% %%i IN (*.remove) DO (call :removefolders "%%i") GOTO :eof :makefolders set name=%1 CALL SET name=%%name:*%cutpath%\=%% set name=%name:~0,-1% rem echo %name% if not exist "%cutbase%\%name%" mkdir "%cutbase%\%name%" goto :eof :copycuts set name=%1 CALL SET name=%%name:*%cutpath%\=%% set name=%name:~0,-1% rem echo %name% copy "%cutpath%\%name%" "%cutbase%\%name%" /y goto :eof :removecuts set name=%1 CALL SET name=%%name:*%oldcutpath%\=%% set name=%name:~0,-1% rem echo %name% del "%cutbase%\%name%" /f /q goto :eof :removefolders set name=%1 CALL SET name=%%name:*%oldcutpath%\=%% set name=%name:~0,-9% rem echo %name% rmdir /s /q "%cutbase%\%name%" goto :eof Now I used the all user start menu so that when a user without lockdown/gpos logs in they still get shortcuts, but when a normal pupil or staff member logs in they don't get the all users start menu. A symbolic link is used so that in windows 7 the start menu searching still works (rather than just having a shortcut that wouldn't allow windows to find programs under it) To try and summarize the script it does 4 things It checks for all folder at the cutpath location (including subfolders) and creates them at the cutbase location It checks for all shortcuts at the cutpath location (including subfolders) and creates them in the same relative path at the cutbase location It checks for all shortcuts at the oldcutpath location and removes them from the same place at the cutbase location if they exist This last bit is a bit of a fudge, but it checks for the file ".remove" (ie no filename before the .) and if it finds at in a folder in the oldcutpath location it tries remove that folder, files and subfolders from the cutbase if it exists (obviously this should be used with care!). What this as meant for us it that user login time is reduced, because all they do is create a symbolic link at login, and then only the first login. It does, however, increase the boot time marginally as all the shortcut management is done then.
  17. Hi, the gpo templates allow post install configuration, so they will allow you to reconfigure without re install, and if you decide later, change at any time to yet newer configuration. It is possible to reconfigure the installer too, but this is done using the OCT, not admin templates, although they come in the same download (Download details: Office 2010 Administrative Template files (ADM, ADMX/ADML) and Office Customization Tool) Here is the technet blog on the download with more detailed info. Office 2010 Group Policy Administrative Template files (ADM, ADMX, ADML) and Office Customization Tool download available - Office IT Pro Blog - Site Home - TechNet Blogs
  18. If you download the office 2010 gpo admin templates you can set this and many other office options.
  19. If you leave "Hide Computer" disabled this should show expanded, mapped network shares on the left We also set this registry key so that it displays the drive letter before the drive name Path: SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer Name: ShowDriveLettersFirst (REG_DWORD) Value: 1 And if you want the auto expand... Path: Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced Name: NavPaneExpandToCurrentFolder (REG_DWORD) Value: 1
  20. I know you aren't particularly looking for a script, but I thought I'd slide another one in just to show you an alternative This script has 2 parts, the script and the config file. The only configuration needed in the script is at the top to point to the config file and then everything in done in a much easier to understand .ini file. This was developed because GPO changes in this domain (shared domain across many schools) take around 2 hours to deploy and I wanted an easier and quicker way to change printer setups. printers.vbs ' Script to mount printers based on computer's OU ' 20/09/2010 by ACB ' Reads printers and OUs from a printers.ini file specified in the printers.ini file ' printers.ini file is set by the strINIFile variable strINIFile = "\\ '*********************************************************** ' Please use the printer name and NOT the printer share name '*********************************************************** ' Default print server is read from the ini file in the [settings] section from the "server" key ' The computer's OU is then read from the [printers] section as a comma separated string ' The first entry in the printer string is used as the default printer ' If the OU is not found no error is returned and no additional printers are mapped ' There must be no spaces between printer share names in the comma separated string ' Custom printers (printers from different print servers) are read from the [custom] section ' The result from the [custom] section provides a comma separated string containing "print server, share name" ' Custom printers are currently set to be the default. ' The must be no space after the comma after the server name in the comma separated string ' Printers for every computer can be added in the [everyone] section ' Finally any other network printers are removed (rather than removing all network printers and reconnecting, this saves time) ' The variable boolRemoveOtherPrinter can be set to false to remove this functionality. boolRemoveOtherPrinter = true ' Also, there is a [nodelete] section whichs allows you to specify network printers that should not be deleted. Set objSysInfo = CreateObject("ADSystemInfo") strName = objSysInfo.ComputerName arrComputerName = Split(strName, ",") arrOU = Split(arrComputerName(1), "=") strComputerOU = arrOU(1) strPrintServer = ReadIni( strINIFile, "settings", "server") Set objDictionary = CreateObject("scripting.dictionary") ' ******************** ' ******************** ' Temp fix to remove all printers first 'RemoveOtherPrinters ' ******************** ' ******************** ' ********************* ' Read and mount printers for computer's OU strPrinters = ReadIni( strINIFile, "printers", strComputerOU) listPrinters = Split(strPrinters, ",") if UBound(listPrinters) >= 0 then MapPrinter listPrinters(intX), true For intX = 1 To UBound(listPrinters) MapPrinter listPrinters(intX), false Next end if ' ********************* ' ********************* ' Look for custom printers strCustomPrinter = ReadIni( strINIFile, "custom", strComputerOU) listCustomPrinters = Split(strCustomPrinter, ",") if UBound(listCustomPrinters) = 1 then ' string has correct format MapPrinterCustom listCustomPrinters(1), listCustomPrinters(0), true end if ' ********************* ' ********************* ' Look for printers for everyone strEvPrinters = ReadIni( strINIFile, "everyone", "Printers") listEvPrinters = Split(strEvPrinters, ",") if UBound(listEvPrinters) >= 0 then For intX = 0 To UBound(listEvPrinters) MapPrinter listEvPrinters(intX), false Next end if ' ********************* ' ********************* ' Remove other network printers if boolRemoveOtherPrinter then RemoveOtherPrinters end if ' ********************* ' ********* ' Functions ' ********* Function MapPrinter(strPrinter,boolDefault) Set objNetwork = CreateObject("WScript.Network") MapPrinterCustom strPrinter, strPrintServer, boolDefault End Function Function MapPrinterCustom(strPrinter,strServer,boolDefault) Set objNetwork = CreateObject("WScript.Network") strFullPath = UCase("\\" & strServer & "\" & strPrinter) 'WScript.Echo "Mounting:" & strFullPath objNetwork.AddWindowsPrinterConnection strFullPath if boolDefault then objNetwork.SetDefaultPrinter strFullPath end if 'WScript.Echo "Mounted:" & strFullPath objDictionary.Add strFullPath, strPrinter End Function Function IsInList(list, value) IsInList = false For i = 0 To UBound(list) if UCase(list(i)) = UCase(value) then IsInList = true end if next End Function Function RemoveOtherPrinters() Dim objPrinters, intDrive, intNetLetter ' This is the heart of the script ' Here is where objPrinters enumerates the mapped drives Set objNetwork = CreateObject("WScript.Network") Set objPrinters = objNetwork.EnumPrinterConnections strNoDelete = ReadIni( strINIFile, "nodelete", "Printers") listNoDelete = Split(strNoDelete, ",") If objPrinters.Count <> 0 Then For i = 0 to objPrinters.Count - 1 Step 2 If Left(ucase(objPrinters.Item(i+1)),2) = "\\" Then 'if not listNoDelete.Contains(objPrinters.Item(i+1)) then if not IsInList(listNoDelete, objPrinters.Item(i+1)) then if not objDictionary.Exists(UCase(objPrinters.Item(i+1))) Then 'WScript.Echo "Leftover: " & objPrinters.Item(i+1) objNetwork.RemovePrinterConnection objPrinters.Item(i+1) end if end if end if Next end if End Function ' e.g. RemovePrinter "\\sba4730-ps\Mono_Tech" Function RemovePrinter(strPrinter) Set objNetwork = WScript.CreateObject("WScript.Network") objNetwork.RemovePrinterConnection strPrinter, true, true End Function Function ReadIni( myFilePath, mySection, myKey ) ' This function returns a value read from an INI file ' ' Arguments: ' myFilePath [string] the (path and) file name of the INI file ' mySection [string] the section in the INI file to be searched ' myKey [string] the key whose value is to be returned ' ' Returns: ' the [string] value for the specified key in the specified section ' ' CAVEAT: Will return a space if key exists but value is blank ' ' Written by Keith Lacelle ' Modified by Denis St-Pierre and Rob van der Woude Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Dim intEqualPos Dim objFSO, objIniFile Dim strFilePath, strKey, strLeftString, strLine, strSection Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ReadIni = "" strFilePath = Trim( myFilePath ) strSection = Trim( mySection ) strKey = Trim( myKey ) If objFSO.FileExists( strFilePath ) Then Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False ) Do While objIniFile.AtEndOfStream = False strLine = Trim( objIniFile.ReadLine ) ' Check if section is found in the current line If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then strLine = Trim( objIniFile.ReadLine ) ' Parse lines until the next section is reached Do While Left( strLine, 1 ) <> "[" ' Find position of equal sign in the line intEqualPos = InStr( 1, strLine, "=", 1 ) If intEqualPos > 0 Then strLeftString = Trim( Left( strLine, intEqualPos - 1 ) ) ' Check if item is found in the current line If LCase( strLeftString ) = LCase( strKey ) Then ReadIni = Trim( Mid( strLine, intEqualPos + 1 ) ) ' In case the item exists but value is blank If ReadIni = "" Then ReadIni = " " End If ' Abort loop when item is found Exit Do End If End If ' Abort if the end of the INI file is reached If objIniFile.AtEndOfStream Then Exit Do ' Continue with next line strLine = Trim( objIniFile.ReadLine ) Loop Exit Do End If Loop objIniFile.Close Else WScript.Echo strFilePath & " doesn't exists. Exiting..." Wscript.Quit 1 End If End Function Function DebugPopup(strMessage) Set WshShell = CreateObject("WScript.Shell") WshShell.Popup strMessage, , , 64 End Function printers.ini [settings] server = [printers] OU = defaultPrinter,nextPrinter,nextPrinter,etc... Digital_Studio = Mono - Studio,Colour - Studio Library = Mono - Library,Colour - Library Mobiles = Mono - Workroom,Mono - Room 6A,Colour - Room 6A Rm_16 = Mono - SEN,Colour - Room 6A Rm_17 = Mono - Music,Colour - Room 6A Rm_1A = Mono - Workroom,Mono - Room 6A,Colour - Room 6A Rm_24 = Mono - Tech,Colour - Tech [custom] Science = ,Mono Science [everyone] Printers = Colour - A3 - Tech [nodelete] Printers = \\xxxx-ps\Mono - Photocopier
  21. Are you running windows 7 clients? If so that secure wireless key is as secure as anyone allowed to use the client...
  22. Did a 7.x msi ever surface?
×
×
  • Create New...