Archive for April 2013
I find myself doing this quite often (like a couple of times in a couple of months 😉 ) in Windows servers and workstations.
There are a few ways that I know.
If you are on a Windows workstation, you could uncheck the On resume, display logon screen under the Screen Saver Settings as in the screenshot below.
Though that is not the way I like especially on our development servers. Here’s how to do it via the Group Policy Editor (take a few seconds to take effect)
Start –> Run –> gpedit.msc –> Local Computer Policy –> User Configuration –> Administrative Templates –> System –> Ctrl+Alt+Del Options –> Remove Lock Computer –> Enabled
Use the Immediate Window instead.
We are in the beginning or re-writing some VB 6.0 code to the .Net framework. Absolute zero business logic known to anybody but the application itself. All we have to do is to trace the VB code line by line, skim the business logic and validation, the program flow out of it, and then come up with a design for the new .Net equivalent.
We will be sitting with the Microsoft Visual Basic 6.0 IDE’s for some part of the day every day, trying to create a test environment with mock data so we could run the VB 6 executable’s code to completion. While we are at it, we will be watching for local variables’ values. Watch window proved to be really helpful, coming from a .Net background, however, when there is a string that is larger than the size of the Watch window itself, and when you try to copy the value out of that variable from the watch window, you’d be seriously disappointed. No matter what you try, all your efforts to copy the entire string value from the watch window will be futile! [Fig 1]
Immediate Window struck me suddenly, that’s it! [Fig 2] type in print variableName and your lives would be spared 😉
[Fig 1] – VB 6 Watch Window
[Fig 2] – VB 6 Immediate Window
In the new era, Visual Studio, we have so many options. The Locals Window, the Autos Window, the Watch Window (up to 4 numbers), the Immediate Window, the debugger tool tip [Fig 3].
[Fig 3] – Visual Studio 2010 Debugger tool tip
One of the security policies from Network Security department of any IT organization are to change the password for a SQL server login (or a Windows AD account) once in a year or 6 months.
With respect to SQL server, if the password for a Login named ‘user4RTWP’ has expired after the stipulated time set by the network policies, and when you try to connect to the SQL server using SQL Server Management Studio with the expired password (for the first time after the password has expired), then the SQL Server Management Studio will prompt you with a change password dialog and you could change the password that way.
However, for all our applications using SQL server authentication (to connect to a database to do their jobs) to work properly, we would plan to change the SQL Login password on a specified data before the expiry. This typically involves a downtime from an application’s perspective because
When you have changed the password for a SQL Login, then the applications using that SQL Login would obviously fail with the famous ‘Login Failed’.
Later you would have to update the application’s config entries with the new password.
In case you wanted to avoid a downtime, it is possible when your database servers are load balanced via clusters. And your application is load balanced via a web farm.
While updating the password for a Login in a database, redirect all the database requests to another database server in the cluster. Once done, you can switch back to the original database server in the cluster.
Post which, you could stop a particular instance of the application in the web farm, and redirect all the user requests to other servers in the web farm. Once done, you can switch back to the original application server.
Though this might seem like it doesn’t require a downtime, some user sessions and transactions might be interrupted. So it is advisable to have a downtime.
Now, the in TSQL there are a couple of options for changing the password for a Login. Let’s take ‘user4RTWP’ as a Login that needs it’s password to be changed.
sp_password – MSDN says this procedure is deprecated and will be removed in the future versions of SQL server. Albeit, the documentation for sp_password is pretty helpful than compared to the documentation for ALTER LOGIN, where ALTER LOGIN is the preferred way to change the password for a Login.
You could login to the database server via ‘user4RTWP’ with it’s original password (or old password) ‘passwordisabouttoExPiReS00n’ and execute the ALTER LOGIN command as below
This command would work if ‘user4RTWP’ had CONTROL SERVER permissions or a part of sysadmin role. Otherwise is going to throw
“Msg 15151, Level 16, State 1, Line 1
Cannot alter the login ‘user’, because it does not exist or you do not have permission.”
Normally, only the database administrator has that kind of permissions, but a regular SQL Login that is created for the application and developers to use does not have those permissions. Now you are mandated to run the TSQL below, which will run just fine even if you don’t have CONTROL SERVER permissions.
In case you wanted to change the password for ‘user4RTWP’ login under the identity of another Login called ‘user4AppX’ , then you would need ALTER ANY LOGIN permissions on ‘user4AppX’.
Hoof, I have been changing these password quite a bit these days.