I was asked by a friend of mine to check why a specific batch file was not being called by a job in Task Scheduler. The first thing I did was to check if the account that was used to run the job had the appropriate permissions. The account used was a domain account with limited privileges. The same account can run jobs on other servers but not on this one. Making it a member of the local Administrators group gave it the permissions to run the job but not as a member of the Power Users group. The former not being an option forced me to check the ACLs on other servers and found out that the account does not have permissions on the CMD.EXE file on my %windir%\system32 folder. After giving the Read and Execute permissions to this account, it was able to run the job using Task Scheduler.
I've seen systems where the Everyone group is granted the same permissions on the CMD.EXE file and such is not a recommended practice due to security vulnerabilities. I'll work on a PowerShell script to check a machine for this and remove the Everyone group, if it exists.
Monday, September 1, 2008
Thursday, August 28, 2008
Need multiple CPUs for your VMWare image?
I normally create VMWare images using my laptop for testing and then deploy on servers for production. My laptop only has an Intel Centrino CPU but the target servers have multiple CPUs. My problem lies where VMWare supports multiple CPUs. This means that configuring my VMWare image on my laptop would not take advantage of having the production server running on multiple CPUs. Initially, I thought it was just a matter of changing the numvcpus variable in the VMX file associated with my image. But, then, the processors are only visible on the Computer Management console and not from Task Manager. I found this article on how to change the kernel and hardware abstraction layer on a virtual machine running Windows Server 2003 with Service Pack 2. I downloaded Windows Server 2003 Service Pack 2 to extract the following files
halmacpi.dl_
ntkrnlmp.ex_
Next, I've expanded the appropriate files needed by the HAL and MP Kernel by running the following command in DOS
expand halmacpi.dl_ halmacpi.dll
expand ntkrnlmp.ex_ ntkrnlmp.exe
This will extract the halmacpi.dll and ntkrnlmp.exe files. Next, copy these files on your Windows directory. Type %windir%\system32 in your Run command to retrieve the Windows directory. After copying the files, modify the boot.ini using the System startup parameters option as you won't be able to do so directly using Notepad. Simply add the following items on the active boot option line. Mine looks something like this
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise, ACPI MPS" /fastdetect /NoExecute=OptOut /KERNEL=ntkrnlmp.exe /HAL=halmacpi.dll
I've added the ,ACPI MPS in the partition(1)\WINDOWS parameter (the comma included to separate the original Windows Server 2003, Enterprise value from what I added) and the /KERNEL=ntkrnlmp.exe /HAL=halmacpi.dll values. This will allow Windows to detect it is running on ACPI multi processor machine when it reboots and install the new MPS HAL. Try rebooting the virtual machine and once you manage to log in, it will prompt you to reboot the server after managing to install the new MPS HAL. After the second reboot, check your Task Manager and see the additional processor as your virtual Windows now recognizes the configuration you just did. I wonder if I can still do this even though I only have a single physical processor on my machine. Although that doesn't have much value, its worth trying out.
halmacpi.dl_
ntkrnlmp.ex_
Next, I've expanded the appropriate files needed by the HAL and MP Kernel by running the following command in DOS
expand halmacpi.dl_ halmacpi.dll
expand ntkrnlmp.ex_ ntkrnlmp.exe
This will extract the halmacpi.dll and ntkrnlmp.exe files. Next, copy these files on your Windows directory. Type %windir%\system32 in your Run command to retrieve the Windows directory. After copying the files, modify the boot.ini using the System startup parameters option as you won't be able to do so directly using Notepad. Simply add the following items on the active boot option line. Mine looks something like this
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise, ACPI MPS" /fastdetect /NoExecute=OptOut /KERNEL=ntkrnlmp.exe /HAL=halmacpi.dll
I've added the ,ACPI MPS in the partition(1)\WINDOWS parameter (the comma included to separate the original Windows Server 2003, Enterprise value from what I added) and the /KERNEL=ntkrnlmp.exe /HAL=halmacpi.dll values. This will allow Windows to detect it is running on ACPI multi processor machine when it reboots and install the new MPS HAL. Try rebooting the virtual machine and once you manage to log in, it will prompt you to reboot the server after managing to install the new MPS HAL. After the second reboot, check your Task Manager and see the additional processor as your virtual Windows now recognizes the configuration you just did. I wonder if I can still do this even though I only have a single physical processor on my machine. Although that doesn't have much value, its worth trying out.
And so I need a GRANT IMPERSONATE permission
SQL Server 2005 has given us the ability to allow more granular permissions, one of which is the EXECUTE AS clause. This would give the user the ability to impersonate a more privileged user should there be a need to do so. But before a user can do impersonation, it must be given the permission to impersonate. This is where the GRANT IMPERSONATE permission is needed - where a lower privileged user needs to impersonate a higher privileged user and not the other way around, I presume.
I've written an article on MSSQLTips.com to demonstrate how to use the EXCECUTE AS clause with the REVERT clause to impersonate users
I've written an article on MSSQLTips.com to demonstrate how to use the EXCECUTE AS clause with the REVERT clause to impersonate users
Monday, August 18, 2008
Most important lesson learned at TechEd Asia 2008
This was supposed to go on the other blog I maintain but I reckon this is something that everyone would appreciate even though it isn't a technical post.
After coming back to Singapore from a week of TechEd Asia 2008 mania, I've spent a lot of time thinking over what the most important lesson I've learned at the event. While a lot of attendees may talk about the great sessions they've attended or the parties they've gone to, speakers about the sessions they did (I had two breakout sessions and one instructor-led lab) and how they've given a great (or screwed up) presentation, mine was a non-technical session done by the people from Microsoft Learning entitled "If I can be a Microsoft Certified Trainer, so can you. MCT Speaks!" I am by far a part-time MCT as I no longer do full-time training. But teaching is my passion. I'd do it for free. Almost a decade ago, Ive decided to pursue the MCT certification because I know it will be my gateway to pursuing a passion in teaching (I've got other dreams about teaching but this was one of my earlier goals). One of the statements made by the moderator reminded me why I was at TechEd Asia. He said, "being an MCT gives you the fulfillment that you have made a difference in someone else's life." On the first day, after the keynote session, a guy with a camera called me while I was on my way to the presenter's room. He said he saw the video which included me promoting Microsoft certification. I was trying to recall how he knew me when he suddenly interrupted me by saying, "I still do what you have taught me about SQL Server 2000 in my work." That hit me hard. He was my trainee some five years back in a SQL Server 2000 course I did for Accenture Philippines and now he's a SQL Server consultant. He was with a few of his colleagues from Accenture and Avanade attending the week-long TechEd Asia event. I even saw one of his colleagues who happened to be one of my students way back when I was still teaching in a university. Now that's what I call fulfillment. I never imagined that they would be who they are now a few years back while they were in my classroom. But everybody has the potential to become great. I just happened to be the avenue for these people.
It's great to know that you are making a difference in someone else's life. For me, it's simply fulfilling a purpose. It just so happen that I am an MCT while fulfilling that purpose. And that is basically the reason why I volunteer to speak at these types of events, whether TechEd Asia, PASS Community Summit, MSDN TechTalks, etc. I believe that one of the people in the crowd would become somebody great someday. That in itself would make a whole lot of difference for that person. And that would be my reward
After coming back to Singapore from a week of TechEd Asia 2008 mania, I've spent a lot of time thinking over what the most important lesson I've learned at the event. While a lot of attendees may talk about the great sessions they've attended or the parties they've gone to, speakers about the sessions they did (I had two breakout sessions and one instructor-led lab) and how they've given a great (or screwed up) presentation, mine was a non-technical session done by the people from Microsoft Learning entitled "If I can be a Microsoft Certified Trainer, so can you. MCT Speaks!" I am by far a part-time MCT as I no longer do full-time training. But teaching is my passion. I'd do it for free. Almost a decade ago, Ive decided to pursue the MCT certification because I know it will be my gateway to pursuing a passion in teaching (I've got other dreams about teaching but this was one of my earlier goals). One of the statements made by the moderator reminded me why I was at TechEd Asia. He said, "being an MCT gives you the fulfillment that you have made a difference in someone else's life." On the first day, after the keynote session, a guy with a camera called me while I was on my way to the presenter's room. He said he saw the video which included me promoting Microsoft certification. I was trying to recall how he knew me when he suddenly interrupted me by saying, "I still do what you have taught me about SQL Server 2000 in my work." That hit me hard. He was my trainee some five years back in a SQL Server 2000 course I did for Accenture Philippines and now he's a SQL Server consultant. He was with a few of his colleagues from Accenture and Avanade attending the week-long TechEd Asia event. I even saw one of his colleagues who happened to be one of my students way back when I was still teaching in a university. Now that's what I call fulfillment. I never imagined that they would be who they are now a few years back while they were in my classroom. But everybody has the potential to become great. I just happened to be the avenue for these people.
It's great to know that you are making a difference in someone else's life. For me, it's simply fulfilling a purpose. It just so happen that I am an MCT while fulfilling that purpose. And that is basically the reason why I volunteer to speak at these types of events, whether TechEd Asia, PASS Community Summit, MSDN TechTalks, etc. I believe that one of the people in the crowd would become somebody great someday. That in itself would make a whole lot of difference for that person. And that would be my reward
Subscribe to:
Posts (Atom)