02 October, 2012

Share a Custom Calendar in Outlook


The default Calendar folder in Outlook is created in each Outlook profile. This folder cannot be renamed or deleted. You can create additional calendar folders and these folders can be renamed or deleted. This section includes instructions to share calendar folders that you create.

While all these procedures were written based on Microsoft Outlook 2003, they can also be applied to a Microsoft Outlook 2007 or 2010 as the procedures are close enough to use a single guide.
   1-  Open Microsoft Outlook 2003, right click on your “Mailbox” and choose “Properties for Mailbox - ….” . This will bring the dialog box for “Outlook Today – [Mailbox – Your Name] Properties
2-     Under Permissions tab, click on Add… button and choose the groups or users that you want to give them access to your calendar. Once the users are added to the list, click on the user to highlight it and under permissions, check the Folder Visible checkbox. This permission will just allow the selected user to see the mailbox and not it’s CONTENT! Click on Apply once finished.

3-     Now we need to set the security on the Calendar that we would like to share. Now, in Outlook 2003, click on Calendar on the left pane.


4-     You should now see all of your calendars in the list. Right click the custom calendar and choose Properties. In this example the calendars name is Custom Calendar.
 
5-     Under Permissions tab, you should see the user that we gave permissions to see the folders earlier. Now select the desired user by highlighting its name and choose a Permission Level under Permissions section. In this example, I’m giving Author rights. Once the permissions are set, click on Apply and OK to close the window. For more information on these permissions please refer the link here. http://office.microsoft.com/en-us/outlook-help/outlook-folder-permissions-HP005242287.aspx

Now that all the permissions are set correctly, users that require access to your Calendar can open your custom calendar in their Microsoft Outlook. Follow the instructions below in order to open a custom shared calendar.

Open a Custom Shared Calendar in Outlook


1-     Open your Microsoft Outlook 2003. Right click on your Mailbox and choose Properties for Mailbox…
2-     Under General tab, click on Advanced… button.
3-     You should now see the dialog box for Microsoft Exchange Server. Under Advanced tab, you will see the Mailboxes section.
Click on Add… button and type in the user name that you want to access its calendar and click OK.
1-     Click OK until all the other dialog boxes are closed.
2-     You can now click on Calendar on the left pane of your Outlook, and you should see the shared calendar as well as all of your personal calendars. The actions that you can make on any calendar depends on the permissions that you were given.
 
While all these procedures were written based on Microsoft Outlook 2003, they can also be applied to a Microsoft Outlook 2007 or 2010 as the procedures are close enough to use a single guide.



19 June, 2012

WMI Filtering, Targeting, Usage & Utilities

WMI filtering is a very neat tool. I personally find its syntax a little complicated. Recently I came across with this 2 line article. How to WMI Filter with computer name. Here is an example.

select * from Win32_ComputerSystem where Name = ‘Computer Name’

If you are looking for more WMI Filter examples, this article has it all…

http://blog.enx1.com/2011/07/03/wmi-gpo-filters-for-operating-system-types/

Here is another example of how to target Windows 7 by its architecture type (X86 or X64). This is great while deploying applications through Group Policy. Not all the applications are compatible both 32 and 64 bit, so you can target only 32bit or only 64bit computers with the help of this WMI query.

Here is how it looks like to target only Windows 7 X86 Systems



select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1" AND NOT OSArchitecture = "64-bit"


Targeting Windows 7 X64 Systems



select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1" AND OSArchitecture = "64-bit"


But, how do you make sure that these WMI queries are actually working? Of course, you can go ahead and try to apply it to a GPO and try on with a couple of machines… Or you can download this little utility from the www.gpoguy.com website written by Darren Mar-Elia. This tool is handy when it comes to try out your WMI filters in your GPO. The tool can pull all configured queries from your Active Directory and validate them. If you are working a lot with GPO’s and WMI’s, this tool is a must have. Here is the link to the download page;
http://www.gpoguy.com/FreeTools/FreeToolsLibrary/tabid/67/agentType/View/PropertyID/93/Default.aspx

I thought, while we are in the subject, why don’t I give away all my secret weapons in terms of WMI coding…
Here is a little list of tools that might save you hours of work and make you look like a decent programmer J

PowerGUI A Graphical User Interface and script editor for Microsoft Windows PowerShell
 
WMICode Creator Generates code in VBScript, C#, and Visual Basic® .NET; you can run the code directly from the tool. You can generate code to query for management information, execute a management task, or receive event notifications.
 
Scriptomatic 2.0
This utility that writes WMI scripts for you. (And, in the process, teaches you the fundamental concepts behind writing WMI scripts for yourself.)

Deploy Java 7 with GPO

Deploying Java 7 Update 5 through your Organization with GPO and Scripts…




Java is a critical component for your computer. A lot of software and web sites rely on the existing of Java on your computer. Probably, without even noticing, you are using Java either for playing Online games, or printing a document or using an application on a smartphone… While Java is a great technology and widely used, it can be harmful for your computer if you don’t keep it up to date. Because Java is an environment where it can execute commands, Oracle is working on the software in order to correct all the security issues. If you are responsible for your workstations on your company, than you are directly responsible to deploy and keep up to date Java. I consider Java as it’s a part of the OS.

Speaking of the devil, Oracle has just updated Java to version 7 Update 5. Here, I’ll explain how to deploy this version to all of your computers at your company whether an older version is already installed or not…

Of course, there is more than 1 way to deploy an application… I’m more a script guy and really lazy… So my method works and easy to implement. Here we go,

First of all, determine if you want to uninstall older versions that are already installed on your computers. It’s highly recommended to do so. In order to uninstall Java silently and centrally, you need to know the “GUID” of the versions that are installed. I covered this part on my last post. Once you have this information, we can start to write our little script that will do all the magic for you. But one more thing, I assume that you already have a shared folder where you can put you setup files and scripts that is accessible from all the computers in your company. For example purposes only, let’s say your file server name is “FILE” and your shared folder is called “Shared” and everything you need to deploy about Java is inside a folder called “Java”. For this type of scenario, here is the code.

@echo off
REM next line uninstalls Java 6u31 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83216031FF} /qn REBOOT=ReallySuppress

REM next line uninstalls Java 6u31 X64
msiexec /X{26A24AE4-039D-4CA4-87B4-2F86416031FF} /qn REBOOT=ReallySuppress


REM next line uninstalls Java 7u4 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83217004FF} /qn REBOOT=ReallySuppress


REM next line uninstalls Java 7u4 X64
msiexec /X{26A24AE4-039D-4CA4-87B4-2F86417004FF} /qn REBOOT=ReallySuppress


REM next line Installs Java 7u5 X86 and creates a LOG file.
"\\FILE\SHARED\JAVA\jre-7u5-windows-i586.exe" /s IEXPLORER=1 MOZILLA=1 /L C:\javaupdate7u5.log REBOOT=ReallySuppress JAVAUPDATE=0


REM next line Installs Java 7u5 X64 and creates a LOG file.
"\\FILE\SHARED\JAVA\jre-7u5-windows-x64.exe" /s IEXPLORER=1 MOZILLA=1 /L C:\javaupdate7u5-X64.log REBOOT=ReallySuppress JAVAUPDATE=0


1- Create a batch file with this code.

2- Download and place your offline installers from http://java.com/en/download/manual.jsp

3- Create a GPO and link it to the OU that has all your computer accounts.

4- Edit the GPO. Browse to “Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown)”. On the right pane, double click on “Startup”. This will bring up the “Startup Properties” window. Click on “Show Files”, this will open the folder where you need to put your Batch file. Copy your script in this folder and close explorer.

5- Now, click on “Add” and “Browse” to choose your script. Click “Open” and “OK

6- Finally click on “Apply

7- You can disable “User Configuration Settings” from this GPO because it does not contain anything in “User Configuration”. This will speed up the processing operation of this GPO. To do that, right click on your GPO and choose “GPO Status” and click on “User Configuration Settings Disabled

With this method, the installation will occur during start up. End user won’t see any activity while this is processed. The only problem with this script, it will run every time you start your computer even if it’s already installed. But when the same version is already installed, it won’t reinstall everything; it will just ignore and not proceed with the setup. The good thing with this method is when folks at Oracle decide to deploy a new version; all you need to do to deploy the latest version is add 2 more lines in your script.
The first lines of this batch file will uninstall the version 6u31 and 7u4 if they are resident, if these version are not installed, you can still leave these lines. Last two lines start the installation from your shared network folder with the necessary switches in order to install JAVA silently and deactivate the auto update feature. You don’t want every computer to download and install Java seperatly by users. So deactivating the AutoUpdate is a must.

15 June, 2012

Find GUID (Globally Unique Identifier) of installed programs


After a long time, I finally motivated myself and wrote this article. As I spent a couple of hours trying to figure out how to find GUID of Java environment for a little deployment project, I realized that it’s not an easy task if you don’t know where to look. You can probably find a couple of third party applications which can do the job for you. But if you are like me and you don’t want another piece of software sitting on your computer for a one time shot then this article is for you… keep reading…

Get your keyboards ready, we are going to use “PowerShell” or “Command Prompt”. We are going to use WMIC for this task. For more information about WMIC, click on the following link.

By using this command here in “CMD” or “PowerShell” you will get a list of all programs on your computer with their “Globally Unique Identifiers”.

wmic product list

After running this command, it can take a couple of seconds before you see the results so just be patient. Through my tests, the output format of PowerShell is way better than “CMD”. So if you can, stick with “PowerShell”. While this command gives you a summary with enough information on installed programs, you can use the following command to get even more information…

wmic product get

Now, what if you need to print this list? You can print this list into a text file by using the following command.

wmic product get > C:\InstalledPrograms.txt

What can I do with GUID?

GUID is very useful information if you are doing a lot of deployment tasks. Every MSI file has a GUID that we can use in order to reinstall or uninstall these programs. It’s a unique number for a software. This number is the same on every computer in the world. Let’s look at my case to give you an example. I needed to deploy the newest version of Java (Java 7u4). While it’s an easy task to deploy the new version, I had no clue how to uninstall the old version (Java 6u34) which was present on each computer in our network. So I came across with a couple of links that were explaining how to uninstall a program silently from computers with msiexec but it requires you to know and use the GUID of the application that you want to uninstall. I’ll be writing about how to deploy Java through your organization…

How to create a list of all installed programs?

This document was meant to explain issues with GUIDs but you can also use this information in order to create a list of all the installed programs without installing any 3rd party programs.

05 March, 2012

Deploying & Updating UltraVNC with Active Directory




UltraVNC is a “must have” tool for “Help Desk” IT stuff. Without this tool, I will have to get up from my chair to go and see a non-critical message that appears on user’s system. Just to press “Enter” for the user. With a VNC application well setup, I could connect to the any user’s screen from my desk with the help of 2-3 clicks. I will explain you how you can setup VNC servers/clients in your enterprise so you can be lazier and be more efficient from your desk.
There is more than 1 way to accomplish this task. I’ll use a method where an “Active Directory” is a requirement. Please read this entire article before preceding your deployment.
Minimum requirements;
-          Active Directory Infrastructure
-          Newest UltraVNC software (Download from HERE)
-          Text Editor Software (I use Notepad++ but Notepad or any other text editor will do the job)
-          Ideally another workstation to test your deployment. It can be a virtual machine.
-          Preconfigured “VNC” configuration file.

1-    Download the UltraVNC software
2-    Put the setup file into a shared folder where all your Workstations have read access. By default, any share without further modification will be enough.
3-    From a text editor program, we will create a batch (.bat) file that will take care of the installation and updates. Keep in mind that the batch file will have only the instructions in order to install UltraVNC silently. So before you go ahead and copy/paste the code here, let’s try to understand what this batch file will do for us.
·         Instructions for a silent install
·         Right after the install, you need to restart the computer or manually start the uvnc service.
·         Check if UltraVNC is already installed & if it’s installed, verify that it’s your deployment. This will be a “Startup script” so each time a user starts their computer, this script will run. If you don’t put any instructions to verify the installation, the setup will run every time a user restarts his/her computer. As verification of an installed application requires advanced programming knowledge, I will cheat in order to accomplish this task easily.
·         Ideally, we can copy a preconfigured configuration file on computers that will setup all the needed settings for your organization.
·         Finally, the script will delete the “Start Menu” folder for UltraVNC because you don’t want your users to see the program easily and change your settings.

So the batch should look like this example;

@echo off
If exist "%ProgramFiles%\UltraVNC\10961.txt" (
Goto END
) else (
Goto SETUP )
:SETUP
"%programfiles%\UltraVNC\unins000.exe" /verysilent /norestart
"\\SharedFolder\UltraVNC_1.0.9.6.2_Setup.exe" /verysilent
"%programfiles%\UltraVNC\winvnc.exe" –install
copy "\\SharedFolder\ultravnc.ini" "%programfiles%\UltraVNC\ultravnc.ini" /y
copy "\\SharedFolder\10961.txt" "%programfiles%\UltraVNC\10961.txt" /y
rmdir /s /q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\UltraVNC"
:END
exit
 You should modify the batch file to make it work in your infrastructure. Consider changing the “ShareFolder” path and filenames. Now, let’s see line by line what this batch file does for us.


Line 1
If exist "%ProgramFiles%\UltraVNC\10961.txt" (
Goto END
) else (
Goto SETUP )


Line 1 (Explanation)
Check if there is a text file called “10961.txt”. This is what I have decided as the numbers indicates the version of the UltraVNC installed on the workstation. By default, this file is not created by UltraVNC setup. So, this line makes sure that the deployment has never occurred on the machines that don’t have this text file. If the text file is there, than do not continue to run the script. Because if the file is there, that means the script has already ran on this machine and the UltraVNC should be installed. If the script doesn’t find the text file in the program files of the UltraVNC folder, than the scripts continue to run.

Line 2
:SETUP
"%programfiles%\UltraVNC\unins000.exe" /verysilent /norestart

Line 2 (Explanation)
This line will uninstall any existing UltraVNC silently and without a restart prompt.


Line 3
"\\SharedFolder\UltraVNC_1.0.9.6.2_Setup.exe" /verysilent
Line 3 (Explanation)
This command runs the setup with “verysilent”. “verysilent” is for a silent (no user interaction) experience.

_____________________________________________________________________


Line 4
"%programfiles%\UltraVNC\winvnc.exe" –install


Line 4 Explanation
This command starts the “winvnc” service. If you don’t add this command, the computer needs another restart in order to start this service which is required for you to be able to connect to VNC.

_____________________________________________________________________
Line 5
copy "\\SharedFolder\ultravnc.ini" "%programfiles%\UltraVNC\ultravnc.ini" /y


Line 5 (Explanation)
This command copies the preconfigured configuration file. In order to create this file, use a test machine to manually install UltraVNC. After the setup, restart your machine and configure all the settings you want from “%programfiles%\UltraVNC\uvncsettings.exe”. Once you are done and happy with your settings, you will find “ultravnc.ini” file in the same “%programfiles%\UltraVNC\” folder. You can copy this file into your shared folder in order to deploy it with your script. /Y switch is for bypass the copy confirmation. It’s mandatory if you want to keep the “silent install” idea.

_____________________________________________________________________
Line 6
copy "\\SharedFolder\10961.txt" "%programfiles%\UltraVNC\10961.txt" /y


Line 6 (Explanation)
This command does the cheating. It copies a text file called “10961.txt” from my shared folder to the installation path. The file contains no data in it. It’s used just to verify if my script has already run on the workstations or not. Next time that I need to update the software, it will be easier for me to deploy the newest version. Let’s say the newest version will be 1.0.9.7.0, and then I’ll change my script to check if “10970.txt” is present at the setup folder of each computer or not instead of “10961.txt” for the version 1.0.9.6.1.

_____________________________________________________________________
Line 7
rmdir /s /q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\UltraVNC"
:END
exit


Line 7 (Explanation)
Finally, this command will delete the “Start Menu” folder for Windows 7 users. So the users won’t see the UltraVNC application as they don’t need to know what you are using to connect to their computer.

_____________________________________________________________________

Now, once you have completed all these tasks. It’s now time to test and apply the script in “Active Directory” so the computers can start receiving your update.
I am using “Group Policy” in order to deploy my script but if you have any other tools, you can use them. Like “Microsoft System Center” products or “Dell Kace”.
-          

  •       Open your “Group Policy Management” console and browse to the “Organizational Unit” that has all your workstations that you want to deploy UltraVNC. In my case, it’s called “Workstations”. 
  •           Right click on this “OU” and choose “Create a GPO in this domain, and link it here”.
  •           Give a name to your GPO. “UVNC Deployment”
  •           Right click on the newly created GPO and choose “Edit”
  •           On the left pane, under “Computer Configuration\Policies\Windows Settins\” click on “Scripts (Startup/Shutdown)
  •           On the right pane, double click on the “Startup”. This will bring up the “Startup Properties” window.
  •           Click on “Add” button and then “Browse” You should copy your script into this folder which is located somewhere on your “Domain Controller” “SysVol” folder.
  •           Once the script is copied on the “SysVol” folder, choose the script to apply.
Now that everything is in place, choose a computer which is in the same “OU” that the script applies and restart the computer. UltraVNC is supposed to be installed on the Workstation with all your settings ready to use. Use these procedures at your own risk.