We have some public display content (basically web-based slideshows on 42" screens around the building) that use Internet Explorer on Windows 7 in kiosk mode to render the content. And now IE11 for Win7 is out, so I figured I should test that out.
PS. The system was originally deployed with IE9, and the upgrade to IE10 caused no issues, and tests in IE11 show no rendering issues either.
However, when during the production cycle, to test content before deploying it I use IE in 'theatre mode' (F11) where the browser goes full-screen and the toolbars, window borders, etc are all hidden in order to have the same visual experience (on a monitor with t he same 1080p resolutions).
This is something I do often - and noticed that the behaviour in that mode has changed from IE10 to IE11: it used to be if you moved the mouse to the top edge of the screen the address bar etc will become visible, and then if you moved the mouse back down they will hide again.
No longer, now you have to right-click. Then it doesn't go away unless you exit F11 & then activate it again.
Anyone else seeing that? I haven't had a chance to test on multiple machines yet, so this may be some local oddity vs. a deliberate change in application behaviour.
Thursday, 7 November 2013
Friday, 28 June 2013
Quick Byte: Script to set the homepage in IE
Quick Byte: VBScript to set the homepage in IE, possibly useful to set a standard setup for a corporate desktop, assuming you didn't have a better option like a GPO.
Dim WshShell
Set WshShell = CreateObject("Wscript.shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page", "http://parmedx.appspot.com", "REG_SZ"
Set WshShell = Nothing
Dim WshShell
Set WshShell = CreateObject("Wscript.shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page", "http://parmedx.appspot.com", "REG_SZ"
Set WshShell = Nothing
Wednesday, 20 February 2013
Quick Byte: Select all column names in a table
Quick Byte: T-SQL query to select all the field/column names from a given table:
Select COLUMN_NAME -- or Select * for all column attributes (ie data_type, default_value, ...)
From INFORMATION_SCHEMA.COLUMNS
Where TABLE_NAME = 'TableName'
Order By ORDINAL_POSITION
Applies to SQL Server.
Select COLUMN_NAME -- or Select * for all column attributes (ie data_type, default_value, ...)
From INFORMATION_SCHEMA.COLUMNS
Where TABLE_NAME = 'TableName'
Order By ORDINAL_POSITION
Applies to SQL Server.
Wednesday, 11 July 2012
Install network printers that are not already installed
Very handy VBScript which I found at WinVistaTips.com thanks to user "markm75". It lets you set up a list of network printers that a PC needs to have installed on it, checks to see which (if any) are not currently installed, and installs only the missing printers.
I've previously used .bat scripts to install network printers, but the problem with those is that the way we had to connect to them (using a command like the following: explorer \\printserver\printername$), once installed the print queue window would always be opened for every printer that was connected to. So if we had 3 printers that had to go on each PC and that script would run on each login, those 3 printers would run through the install process & the 3 print queue windows will open up on each login as well. Even if the printers were already installed.
This script handily works around both issues: printers that are already installed are just skipped from further processing, and if missing, the installation is silent without any dialogs or windows popping up (unless if UAC is required to install a driver or some such).
So here it is for posterity (in case those forums are ever shut down – and to improve it’s discoverability – it’s quite useful). Hopefully it will help others. I've adjusted the script a little from the original here, but it's identical where it counts.
I've previously used .bat scripts to install network printers, but the problem with those is that the way we had to connect to them (using a command like the following: explorer \\printserver\printername$), once installed the print queue window would always be opened for every printer that was connected to. So if we had 3 printers that had to go on each PC and that script would run on each login, those 3 printers would run through the install process & the 3 print queue windows will open up on each login as well. Even if the printers were already installed.
This script handily works around both issues: printers that are already installed are just skipped from further processing, and if missing, the installation is silent without any dialogs or windows popping up (unless if UAC is required to install a driver or some such).
So here it is for posterity (in case those forums are ever shut down – and to improve it’s discoverability – it’s quite useful). Hopefully it will help others. I've adjusted the script a little from the original here, but it's identical where it counts.
Option Explicit
On Error Resume next
Dim Printers(3), WshNetwork, objWMIService, colPrinters, bFound, InstalledPrinter, Printer
'array of network printers we need to have installed
Printers(0) = "\\printserver\HP2600"
Printers(1) = "\\printserver\HP4200"
Printers(2) = "\\printserver\Lexmark360"
Set WshNetwork = CreateObject("WScript.Network")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
' "." = local PC, else put in PC name instead of the dot
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where Local = False")
'Populate Printers Collection on the PC specified above
If colPrinters.Count <> 0 Then
'loop through array of Printers we need to have installed
For each Printer In Printers
bFound = False
'loop through printers currently installed on target machine,
'compare each to the printer we need installed:
For Each InstalledPrinter In colPrinters
'.ShareName is the share ' servername for server
If Ucase(InstalledPrinter.ServerName & "\" & InstalledPrinter.ShareName) = _
Ucase(Printer) Then
bFound = True 'if Printer is already installed/found, skip to next printer
Exit For
End If
Next
If bFound = False Then 'if Printer is not installed, install it
If Printer <> "" Then '(if Printer is named/not null string)
WshNetwork.AddWindowsPrinterConnection Printer
End If
End If
Next
End If
Set WshNetwork = Nothing
Set objWMIService = Nothing
Set colPrinters = Nothing
Friday, 15 June 2012
System File Checker
This is handy tool I found. Have you had a Windows system encounter problems due to corrupted system DLLs? A while back I encountered that on a Win7 system that would refuse to run Windows Updates with a "Program cannot start because sqmapi.dll is missing" error. It wouldn't run an offline SP1 install either due to the same problem.
The solution: System File Checker.
Steps:
Microsoft support link:
http://support.microsoft.com/kb/929833
The solution: System File Checker.
Steps:
- Open an elevated command prompt (Start -> type "cmd" -> Right-click the cmd shortcut and select "Run as Administrator"
- Provide admin credentials if UAC prompts you.
- Type: SFC /scannow and press enter. The program will take a few minutes to check each system dll for corruption and for wrong versions, and replace them as needed.
- When it's finished, type findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >%userprofile%\Desktop\sfcdetails.txt to put a log file onto your desktop, which you can review to see what was updated.
- Repeat steps 3-4 two more times (run SFC three times) to ensure that no files were missed. You may want to reboot after each run - though when I did it I didn't have to.
- Profit! (ie I was once again able to run Windows Update normally and get the Service Pack installed)
Microsoft support link:
http://support.microsoft.com/kb/929833
Wednesday, 13 June 2012
VBScript to authenticate against Active Directory
Came across this function somewhere online a long time ago to validate provided user credentials against Active Directory in VBScript (mainly if you had to update a "Classic" ASP 3.0 application to use AD authentication vs some other non-IIS integrated method - like querying a database). More recently I noticed that this was hard to find thanks to the age of ASP, so here it is for posterity.
Thanks to whomever wrote it all those years ago!
Here it is, basically the function takes a username & password as parameters, and in the example has the domain hard-coded in the domainName variable, though you can easily change it to pass that as a parameter as well. It then uses ADO to connect to the Active Directory domain using the provided credentials to try to execute a simple query. If it succeeds, then the credentials are good. If it errors out, then the username/password combination is bad.
Note: I've only used this approach on computers that are joined to the AD domain in question.
In use:
Thanks to whomever wrote it all those years ago!
Here it is, basically the function takes a username & password as parameters, and in the example has the domain hard-coded in the domainName variable, though you can easily change it to pass that as a parameter as well. It then uses ADO to connect to the Active Directory domain using the provided credentials to try to execute a simple query. If it succeeds, then the credentials are good. If it errors out, then the username/password combination is bad.
Note: I've only used this approach on computers that are joined to the AD domain in question.
Function validateUser(username, password)
Dim adConn, adCom, adRS
Dim domainName
On Error Resume Next
domainName = "mydomain.com"
err.clear
Set adConn = Server.CreateObject("ADODB.Connection")
adConn.provider ="ADsDSOObject"
adConn.properties("user id") = username
adConn.properties("password") = password
adConn.Properties("Encrypt Password") = true
adConn.Open "DS Query"
Set adCom = CreateObject("ADODB.Command")
Set adCom.ActiveConnection = adConn
adCom.CommandText = _
"select cn from 'LDAP://" & domainName & "' WHERE objectCategory='user'"
Set adRS = adCom.Execute
If err.Number = 0 Then
validateUser = True
Else
validateuser = False
End If
adRS.close
adConn.close
Set adRS=nothing
Set adCom=nothing
Set adConn=nothing
End Function
In use:
<%
Dim bLoggedIn, usr, pwd
bLoggedIn = False
usr = Trim(Request("user")) 'validate your input IRL (In Real Life)!
pwd = Trim(Request("pwd"))
If usr<>"" and pwd<>"" Then
bLoggedIn = validateUser (usr, pwd)
End If
%>
<html>
<body>
<% If bLoggedIn = False Then %>
<form method=post>
<p>Username: <input type="text" name="user" value="" /><br/>
Password: <input type="password" name="pwd" value="" /><br/>
<input type="submit" value="Login" /></p>
</form>
<% Else %>
<h2>Logged in!</h2>
<% End If %>
</body>
</html>
Saturday, 9 June 2012
First Post (second actually)
My actual first post was about a problem I encountered at work. This "First!: post is to introduce the blog.
The main point in setting this up is to document for myself, and anyone else who would find it helpful, various problems and solutions that I've come across in my work as an IT Guy™. In time I'll be posting various code snippets from scripts & queries etc. that I've used in my work.
My first post was just the problem & stepping back/recovering from it, and does not yet have an actual solution. Hopefully that won't be the dominant trend.
The main point in setting this up is to document for myself, and anyone else who would find it helpful, various problems and solutions that I've come across in my work as an IT Guy™. In time I'll be posting various code snippets from scripts & queries etc. that I've used in my work.
My first post was just the problem & stepping back/recovering from it, and does not yet have an actual solution. Hopefully that won't be the dominant trend.
Subscribe to:
Posts (Atom)