Printer sharing in Windows Vista
Windows Vista comes by default enhanced security control – User Access Control (UAC). It’s a good feature but for me is quite annoying as every files deletion and system changes, there will be pop up asking your permission. Arghhhh.. I finally turn it off and everthing turns back to normal, no more POP-UP! But…. today when I tried to map to a network printer, I was being prompted for some error saying:
Windows cannot connect to the printer. The specified print monitor is uknown
Searching through the Net and it looks like lots of Vista users as like me has the UAC disabled and having this problems. If you need to map to a network drive, you will need UAC enabled.
Mass ‘replace’ in Linux
The following command will have ease your jobs if you would like to do a mass replace of certain keywords in a directory to a certain words
replace ‘oldword’ ‘newword’ — /full/physical/path/*
Automating Windows Process Priority
Recently, I have seen one of the mail server performance I am working on has been dragging down which causes webmail / POP3 to be slow down. It takes me up some times to diagnose on the source of the problems and eventually the drive I/O is the cause of the issue. Well…. upgrading drives by mirroring is pain in ass as it involve down time and I will need to stand by at the data center for the whole night again.
Doing some research on the Net, it cames to my attention that we can prioritize the process running in the Windows background to receive more processing power from the server compare to other processes just like what we have in Linux by seeing on their ‘nice’ status.
We can prioritize the processes through the Windows Task Manager or by using the Sysinternal tools – ProcessExplorer to do the trick. Now question is, how do you reset the processes which constantly being restarted – such as IIS w3wp.exe worker processes after its application pool recycling in Windows 2003? Manually? Wow… you will then need to spend 24 hours sitting in front of your terminal for that.
I have asked around and doing some Googling, and at last, I came to this TechNet article – Modifying Process Startup Options which helps to save my ass from sitting in front the terminal for 24 hours.
Below is the sample scripts. Generally, you will just need to replace the ‘PriorityClass’ and the ‘ProcessName’ ( w3wp.exe ) with your actual process name and voila, you are ready to go. If you want this to be automated, you may setup a cron batch file to auto run it for how often as you need.
Const High = 128
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)
Set colProcesses = objWMIService.ExecQuery(“Select * from Win32_Process Where Name = ‘w3wp.exe’”)
For Each objProcess in colProcesses
objProcess.SetPriority(High)
Next
Micorosoft SQL Server, Error:3154
The following errors pop up today when I was trying to restore a database for a user in SQL 2005.
The backup set holds a backup of a database other than the existing database. RESTORE DATABASE is terminating abnormally. ( Micorosoft SQL Server, Error:3154)
You may get the backup restored using the following T-SQL
RESTORE DATABASE [DBName] FROM DISK = N’C:\DBBackup.bak‘ WITH FILE = 1, REPLACE,STATS = 10
Controlling Windows Server Remote Session
What do you do when you are trying to login to the server via RDP and you are being prompted that the session is full? For me, is kinda of frustrated as I will need to login via another server, open up the Terminal Service Manager to connect to the server to check on which session is left connected without proper log-off.
Well, Windows 2003 server comes with a handy command which allow you to connect as a third session to the server. The third session will be the console session. Here’s the command you may execute from another server and make the connection as a console session:
mstsc /v:servername /console
To check on the remote session via command line, you may use the qwinsta and rwinsta. qwinsta stands for Query WINdows STAtion while rwinsta is Reset WINdows STAtion
To query a remote session:
qwinsta /server:
Example :
qwinsta /server:win2k3
SESSIONNAME USERNAME ID STATE TYPE DEVICE
console 0 Conn wdcon
rdp-tcp 65536 Listen rdpwd
rdp-tcp#2 andy 1 Active rdpwd
To reset a remote session after you have gather the session info, we will use the rwinsta.
rwinsta /server:
As per the example above, we will reset the session owned by “andy” with ID 1.
rwinsta /server:win2k3 1
Categories
Recent Posts
- yum update – TypeError: unsubscriptable object
- Magento with Windows IIS
- Helm3 : File Manager Not Showing any Files
- Helm4 Error on Remove Domain
- SQL 2008 Maintenance Plan Execution Error
Recent Comments
- Superrookie on Cannot create Windows Service for MySQL.Error:0
- Martin on Cannot create Windows Service for MySQL.Error:0
- About MySQL.Error On Windows 7 | Robin Blog - UED, Open source, SEO, Marketing on Cannot create Windows Service for MySQL.Error:0
- Totally Frustrated MySQL Newbie on Cannot create Windows Service for MySQL.Error:0
- Simon on Cannot create Windows Service for MySQL.Error:0

