Alexander’s Blog

May 30, 2011

Turn Windows 7 into a Free Wireless Router

by @ 9:04 am. Filed under Applications, Windows 2008, Windows 7, Wireless/Mobile

You may have seen software that turns your Windows 7 computer into a wireless router. In the past, I have downloaded Connectify software. On paper it looked good but when I installed the free version of Connectify I discovered that I could only use WEP. There was no support for WPA2-PSK as advertised on their homepage. I am guessing they must have a paid version of Connectify that will allow people to use security. Anyone referring to WEP protocol as secure loses credibility right off the bat. WEP does not provide end-to-end security and is not considered secure by most security experts today. If that wasn’t bad, Connectify only allowed me to use a password that was limited to something like 4-12 characters and the password was limited to numbers 0-9 and letters a-f. That’s right, you can only use letters a-f. Bottom line: Do not let your friends and family install the free version of Connectify. It’s security a joke.

Recently I ran across another software, developed by a fellow MVP by the name of Chris Pietschmann. Chris is a Windows Live Platform MVP and his free, virtual router software is available from Microsoft’s CodePlex community site, which is a distribution point for open source software. The Virtual Router software turns any Windows 7 or Windows Server 2008 R2 computer into a WiFi Hotspot using Windows 7′s Wireless Hosted Network (Virtual WiFi) technology. Virtual Router allows you to wirelessly share any Internet connection (LAN, WiFi, Cable Modem, Cellular, or even dial-up modem) with any WiFi device (Laptop, Smart Phone, iPod Touch, iPhone, Android Phone, Zune, Netbook, wireless printer, etc.).

The software, written entirely in C#, does not have the password limitations of Connectify. Another good thing about the Virtual Router is that it is completely free of ads. And the best thing about the Virtual Router is that it defaults to WPA2 for secure wireless connectivity. WPA2 is one of the most, if not the most, secure wireless encryption available today.

The software is currently in its beta version. You can download beta 0.9 here.

May 27, 2011

Problem: SharePoint 2010 Forcing Saves to Local Computer’s Hard Disk

by @ 12:06 pm. Filed under Articles, SharePoint, Tips & Tricks, Windows 2008

I recently create a new virtual machine image in Hyper-V for SharePoint 2010 that we plan to use to teach our SharePoint 2010 Bootcamp course at SeattlePro. The virtual machine is running SharePoint Server 201o on a Windows Server 2008 R2. Today I noticed that the new image was forcing me to save Word files locally, rather than allowing me to save the files on the server. I tried experimenting with the Protected View in the Trust Center, which solved one error of opening the file but the documents could only be saved to the local drive.

Problem

Here are the exact issues that I ran into.

  1. While working on the server, when I would open a file that already existed in a SharePoint library and then clicked on Save, it would save it on the server. That was good. However, if I clicked on Save As, the only option was to save it to the local hard drive on the server, not to the SharePoint library where I wanted it to save.
  1. If I created a new Word document from the template in SharePoint library, the only option was to save it locally. Period! There was absolutely no way to save it to the server. That’s not what I expected.

Solution

After trying various things, I finally realized that I forgot to install the Desktop Experience on my server, which I normally do on our classroom SharePoint servers. I installed Desktop Experience and rebooted the server which allowed me to save files to the SharePoint server. Actually, it defaulted to saving on the server but I could also save it locally. Problem solved!

Installing Desktop Experience

If you use Windows Server as your primary operating system in a test, training or development environment I encourage you to install the Desktop Experience because it will allow you to use some of the Windows 7 features that are normally not available on the server. If you read Microsoft’s description of Desktop Experience in the help file on the Windows Server 2008 R2, you would never guess that it has anything do with what I just told you about resolving the SharePoint problem. According to Microsoft, the Desktop Experience includes the following Windows 7 components and features:

  1. Windows Media Player
  2. Desktop themes
  3. Video for Windows (AVI support)
  4. Windows SideShow
  5. Windows Defender
  6. Disk Cleanup
  7. Sync Center
  8. Sound Recorder
  9. Character Map
  10. Snipping Tool

Simply installing Desktop Experience doesn’t enable all these features. You still have to manually enable these features, which in fact is a good thing. For example, after installing Desktop Experience you can go to the Services Console and enable Themes service. Obviously, the Desktop Experience does much more than what’s listed in the help file. Based on my experience, I consider it a must on any SharePoint server. Someday I should make a list of all the issues that I run into by not having Desktop Experience installed on a server but the problem is that now that I know it is important, I install it right off the bat and would not know what would happen if I didn’t install this feature.

Best Practice: Always enable Desktop Experience on any SharePoint Server 2010 that you work with. Keep in mind that simply installing Desktop Experience doesn’t enable any of the Windows 7 components or features. You still have to manually enable the features on the server.

To install Desktop Experience on your Windows Server 2008 R2 go to Server Manager -> Features -> Add Features and select Desktop Experience. You must restart the server to finish the installation process.

If you have trouble opening a document you may still have to disable the Protected View in Word (which is a separate issue) by going to File -> Options ->Trust Center -> Trust Center Settings ->Protected View. However, installing Desktop Experience on the SharePoint server definitely resolved my issue.


Copyright ©2011 Zubair Alexander. All rights reserved.

May 23, 2011

How to Start a Stopped Windows Service Automatically Using a Script

by @ 8:29 pm. Filed under Articles, Scripting, SharePoint, Tips & Tricks, Windows 2008

If you have worked with SharePoint Server 2010, you may have noticed that once in a while, especially after a reboot, the Forefront Identity Manager (FIMService) doesn’t start. Sometimes both the FIMService and the Forefront Identity Manager Synchronization Service (FIMSynchronizationService) don’t start. Without FIM services for all practical purposes your SharePoint is out of commission.

To address this issue, I figured it would be great to write a batch file that will look for these services to see if they are running, if not, it will start these services and log the activity in a log file. If the service is running on multiple computers. this script will even take care of all the remote servers and start the service, assuming you have the proper administrative rights. I want to thank Jerry, a Microsoft MVP – Windows Expert – Consumer, for writing this script on forums.techguy.org. I modified his original script to fit my need.

NOTE: To benefit from the script in this article you must have at least a fundamental knowledge of batch files and scripting. You should also understand what environmental variables are and how to modify the system path.

What Does the Script Do?

I wrote this batch file that will check to see if the two FIM services have started. If not, it will start them automatically. Here’s exactly what the script does. It sets a log file, called log.txt. If the file exists, it will delete it so you only have the information from the last time you ran the script. Instead of using the “net start” command, which will work on the local computer, it uses psservice.exe which is part of Sysinternals Suite and can be downloaded from Microsoft’s Web site here. I wrote the batch file with SharePoint in mind but you can use this script for any service on any Windows computer. In a typical SharePoint environment, SharePoint is installed on more than one server. If you want to make sure that the service is running on multiple computers, simply add the names of the computers in the computers.txt file.

Best Practice: Add the folder where you have copied the Sysinternals tools, such as psservice.exe, to the system’s path. That way you can run the psservice.exe from any folder.

I like to keep the batch file (FIM.bat), the log file (log.txt) and the server name file (computers.txt) in a folder called BATCH. I also like to add the BATCH folder to the path.

You should save the script as a .bat file. Make sure that it does not have a .txt extension. If you want, you can schedule this batch file to run every so often. That way you can ensure that your services are always running. If a service has already started it will only take a second for it to check and log the information. There is no overhead that you need to worry about. You can check out my blog post on how to accomplish that. The link is posted at the end of this article.

Determine the Name of the Service

In the script you should replace the name of the service with your service name. To find out what service name you should use go to Services Console (services.msc) and double-click the service. On the General name look for Service name. For example, the name of the Forefront Identity Manager Service is FIMService, as shown below.

The script will check to see if the service is running, stopped, or paused and will document the result accordingly in the log file. I have set the script to check the status 10 times. You can adjust this setting if necessary.

Running Same Script for Multiple Services

To make things simple, I start both the services in the same script. There are other ways to handle this situation but I wanted my script to be pretty flexible and decided to implement what I wanted to accomplish using this method.

In the first section, I check for the FIMService and in the second section I essentially run the same script for FIMSynchronizationService with slight modification. For example, I don’t want the log file to be deleted after the FIMService is started because I also want to see the results for the second service so I commented out the line that deletes the log file in FIMSynchronizationService section.

Dealing With Multiple Computers

You can use this script to remotely start a service on remote computers. Simply add the name of the computers in the computers.txt file on separate files. If you have only one computer, just add its name to the computers.txt file. For example, if you have 3 servers named server1, server2, and server3, your computers.txt file will look like this.

Once the batch file is complete you can verify the status of the services in the Services Console and also check the log file for the activity that took place.

The Log File

The script also utilizes a log.txt file. Each time the batch file is executed it first deletes the old log file and then creates a new log.txt file and enters the necessary information in the file for you. If both the FIM services were stopped, your log file will display the following information.

Sample Script

I named my script FIM.bat because I am using it to start two FIM services. Obviously, you can name it whatever you want but keep the name short.

Best Practice: Use the 8.3 file naming convention for your batch file. In other words, do not use more than 8 characters (excluding the extension) for the file name. For example, instead of naming it something like startsrvcs.bat, name it strtsrvc.bat to follow the 8.3 file naming convention.

You can copy the following text to the clipboard and then paste it into notepad. Modify the script as mentioned above and then save it as a batch file using 8.3 naming convention. Make sure you test the script in a test environment first to make sure it does what you expect it to do.

@echo off

cls

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Check the status for FIMService

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Set LogFile=log.txt

If Exist %LogFile% Del %LogFile%

Set Errors=

For /f “tokens=1″ %%i In (computers.txt) Do (

Call :process %%i

If %ErrFlag%==1 Set Errors=1

)

If Defined Errors Echo FIMService on some machines could not be started. Please check the log in %LogFile%.

Goto :STOP

Set LogFile=log.txt

If Exist %LogFile% Del %LogFile%

Set Errors=

For /f “tokens=1″ %%i In (computers.txt) Do (

Call :process %%i

If %ErrFlag%==1 Set Errors=1

)

If Defined Errors Echo FIMService on some machines could not be started. Please check the log in %LogFile%.

Goto :STOP

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Subroutines

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:process

:: %1 is the Remote Machine Name

Set ErrFlag=0

Set SERVICE1=FIMService

:FIMService

Call :CheckState %1

If “%STATE%”==”RUNNING” (

Echo FIMService on %1 has already started.>> %LogFile%

Goto :EOF

)

If “%STATE%”==”STOPPED” (

Echo FIMService on %1 is in Stop mode. Attempting to start the service….>> %LogFile%

psservice \\%1 Start %SERVICE1% 2>Nul

Call :Wait %1

Goto :EOF

)

If “%STATE%”==”PAUSED” (

Echo FIMService on %1 is in Paused mode. Attempting to start the service…>> %LogFile%

psservice \\%1 cont %SERVICE1% 2>Nul

Call :Wait %1 Re-

Goto :EOF

)

Echo FIMService on %1 is in an Unknown state. Please check the %1 system.>> %LogFile%

Set Errflag=1

Goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:CheckState

Set STATE=

For /F “Tokens=3 Delims=: ” %%a In (‘psservice 2^>Nul \\%1 query %SERVICE1%^|Find /I “STATE”‘) Do Set STATE=%%a

Goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:Wait

:: %1 is the Remote Machine Name

:: %2 is null if attempting to start, is Re- if restarting

Set loop=0

:Check

:: Will check state 10 times, adjust as needed.

If %loop%==10 Goto NoStart

:: Wait 1 second for service to (Re-)start (can also use sleep utility)

:: adjust -w as needed units are milliseconds

Ping 1.0.0.0 -n 1 -w 1000 >Nul

Call :CheckState %1

If NOT “%STATE%”==”RUNNING” (set /a loop+=1) & Goto Check

Echo FIMService on %1 has %2started successfully.>> %LogFile%

GOTO :EOF

:NoStart

Echo Unable to %2start FIMService on %1>> %LogFile%

Set ErrFlag=1

Goto :EOF

)

:STOP

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Check the status for FIMSynchronizationService

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

Set LogFile=log.txt

:: If Exist %LogFile% Del %LogFile% (Log file should not be deleted after the FIMService is started)

Set Errors=

For /f “tokens=1″ %%i In (computers.txt) Do (

Call :process %%i

If %ErrFlag%==1 Set Errors=1

)

If Defined Errors Echo FIMSynchronizationService on some machines could not be started. Please check the log in %LogFile%.

Goto :STOP

Set LogFile=log.txt

If Exist %LogFile% Del %LogFile%

Set Errors=

For /f “tokens=1″ %%i In (computers.txt) Do (

Call :process %%i

If %ErrFlag%==1 Set Errors=1

)

If Defined Errors Echo FIMSynchronizationService on some machines could not be started. Please check the log in %LogFile%.

Goto :STOP

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Subroutines

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:process

:: %1 is the Remote Machine Name

Set ErrFlag=0

Set SERVICE1=FIMSynchronizationService

:FIMSynchronizationService

Call :CheckState %1

If “%STATE%”==”RUNNING” (

Echo FIMSynchronizationService on %1 has already started.>> %LogFile%

Goto :EOF

)

If “%STATE%”==”STOPPED” (

Echo FIMSynchronizationService on %1 is in Stop mode. Attempting to start the service….>> %LogFile%

psservice \\%1 Start %SERVICE1% 2>Nul

Call :Wait %1

Goto :EOF

)

If “%STATE%”==”PAUSED” (

Echo FIMSynchronizationService on %1 is in Paused mode. Attempting to start the service…>> %LogFile%

psservice \\%1 cont %SERVICE1% 2>Nul

Call :Wait %1 Re-

Goto :EOF

)

Echo FIMSynchronizationService on %1 is in an Unknown state. Please check the %1 system.>> %LogFile%

Set Errflag=1

Goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:CheckState

Set STATE=

For /F “Tokens=3 Delims=: ” %%a In (‘psservice 2^>Nul \\%1 query %SERVICE1%^|Find /I “STATE”‘) Do Set STATE=%%a

Goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:Wait

:: %1 is the Remote Machine Name

:: %2 is null if attempting to start, is Re- if restarting

Set loop=0

:Check

:: Will check state 10 times, adjust as needed.

If %loop%==10 Goto NoStart

:: Wait 1 second for service to (Re-)start (can also use sleep utility)

:: adjust -w as needed units are milliseconds

Ping 1.0.0.0 -n 1 -w 1000 >Nul

Call :CheckState %1

If NOT “%STATE%”==”RUNNING” (set /a loop+=1) & Goto Check

Echo FIMSynchronizationService on %1 has %2started successfully.>> %LogFile%

GOTO :EOF

:NoStart

Echo Unable to %2start FIMSynchronizationService on %1>> %LogFile%

Set ErrFlag=1

Goto :EOF

)

:STOP

By the way, I have tested this batch file numerous times and it worked perfectly every single time. If you decide to schedule this batch file, check out my article How to run a batch file as a task in Windows Server 2008.


Copyright ©2011 Zubair Alexander. All rights reserved.

May 18, 2011

CNNMoney Report: IT Systems Engineer Named Best U.S. Job

by @ 10:56 am. Filed under News

According to a CNNMoney.com report, IT Systems Engineer is the best job in United States. The report listed top 50 Best Jobs in America and the Systems Engineer job came on top with the highest aggregate score based on Satisfaction, Pay, Stress, Stability, Growth, Flexibility, and Benefit to Society.

The source of this 2009 report is listed as PayScale.com, Bureau of Labor Statistics, Conference Board Help Wanted Online Data Series, and MONEY research. The 2009 report is the latest report. The 2010 report is not posted yet. Interestingly, there were 3 IT jobs in the top 10 category on this list.

1. Systems Engineer

5. IT Project Manager

8. Computer/Network Security Consultant

You can check out the complete list of the top 50 best jobs at CNNMoney.com.

Contact E-mail | Terms of Use | Privacy Policy

Copyright © 2013 Zubair Alexander. All rights reserved.

Internal Links

Search Blog

Categories

Archives

May 2011
M T W T F S S
« Apr   Jun »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

RSS Feeds

TechGalaxy Visitors

24 queries. 0.538 seconds