Quick Access to System Properties

Tired of having to go around the houses to look at the system properties on a server or workstation ? The quickest way to gain access is to use the built-in shortcuts. Just enter the below at the start menu search box to gain fast access:

Advanced Tab – systempropertiesadvanced
Remote Tab – systempropertiesremote
Hardware Tab – systempropertieshardware
Computer Name Tab – systempropertiescomputername
System Protection Tab – systempropertiesprotection
Data Execution Prevention – systempropertiesdataexecutionprevention
Performance Options – systempropertiesperformance

Of course, you don’t have to remember all of the above, just using systempropertiesadvanced will get you straight to a single tab so that you can navigate from there.

List Users who have logged on to XenApp

Want to know who has logged on to your Citrix server ?

You can just look in the security log in event viewer and filter down but it’s so much easier using the command line. Just open up a cmd prompt and enter

auditlog (all one word)

This will let you list all the sessions from the event log and even pipe them out to a text file for later analysis or reporting.

Changing the icon used for folders

When building a desktop image you may want to have some corporate folders which you want to “stand out” from the others and also let users know what the folder should be used for. For example, you may place folders in the “All Users” menu folder or within the users “My Documents” folder.

This can be accomplished by changing the folders icon and adding a tool tip so that a hint appears if a user hovers their mouse over the folder. This is relatively simple to achieve.

  1. Create the folder. I have create done called “RegistryTemplates”

     

  2. Mark the folder as a system folder. Open a command prompt and mark the folder as a system folder using attrib +s PathFolderName

     

 

  1. Create a text file and name it Desktop.ini. Use Notepad to create this file and ensure it is saved in Unicode format. Also, enclose the file name in quotation marks to ensure that the.txt extension isn’t applied.

  1. Edit the Desktop.ini file created (by double clicking on it). Add a section header

     

    [.ShellClassInfo]

     

  2. Then enter values to inform the file system how to display the folder.

Entry

Value

ConfirmFileOp

Set this entry to 0 to avoid a “You Are Deleting a System Folder” warning when deleting or moving the folder.

NoSharing

Not supported under Windows Vista or later. Set this entry to 1 to prevent the folder from being shared.

IconFile

If you want to specify a custom icon for the folder, set this entry to the icon’s file name. The .ico file name extension is preferred, but it is also possible to specify .bmp files, or .exe and .dll files that contain icons. If you use a relative path, the icon is available to people who view the folder over the network. You must also set the IconIndex entry.

IconIndex

Set this entry to specify the index for a custom icon. If the file assigned to IconFile only contains a single icon, set IconIndex to 0.

InfoTip

Set this entry to an informational text string. It is displayed as an infotip when the cursor hovers over the folder. If the user clicks the folder, the information text is displayed in the folder’s information block, below the standard information.

 

  1. A typical set of entries would look like the below.

     

    [.ShellClassInfo]

    IconFile=C:WindowsRegedit.exe

    IconIndex=0

    InfoTip=”Registry templates for updating standard settings within the operating system”

     

     

  2. The above will set the icon to be that used by Regedit. The icon index is the index number of the icon within the icon file. If a bespoke icon is to be used, this can be placed within a hidden folder underneath the folder being displayed (use attrib +h FolderName to hide the folder).

     

  3. Save the file.

     

  4. Now open a command prompt and set the desktop.ini file to be a hidden system file using the command attrib +s +h PathFileName.

     

     

  5. The folder will now display with the regedit icon to provide a visual queue that the folder contains items relating to the registry.

     

     

  6. Hovering the mouse over the folder displays the tooltip.

     

Create your own Event Viewer Entries

There’s a little known tool that sits on your computer called eventcreate.exe. Its a command line tool and it lets you create your own event log entries in the event viewer (but not the security log for obvious reasons). You can create any event with an event ID up to 1000 (events above that value tend to be used by Microsoft).

To use the tool simply go to a command prompt and create an event with appropriate switches – you can get a list of all these and an example of how to use the tool by entering

eventcreate /? at the command prompt.

Why would you want to do this ? Well, one thing is to test any monitoring tools you have. The other thing is you can call the tool to easily write to the event log from any scripts you create, for example when deploying software from a batch file you can write an event to the log showing that the software was deployed.

My favourite use is around April Fools Day. A typical example would be:

EVENTCREATE /T ERROR /ID 69 /L APPLICATION /SO iexplore.exe /D “<username> has now spent a total of 465 hours browsing http://www.facebook.com this calendar year”

Just run the command using a remote command prompt on the users machine and then ask them and why you have received an alert about their browsing then point them to the event log.

How to format GPResult

You probably know how to run GPResult to see which policies etc are being applied to an end user workstation or server but did you know for Windows 2008 / R2 and Windows 7 there is now an easy way to format those results ? Just run the command below:

GPResult /H GPResult.html

and the results will be held in a html formatted page. Run the command below and it will display the page automatically for you.

GPResult /H GPResult.html & GPResult.html

How to duplicate entries in Excel

You know how it is. You are filling out an Excel spreadsheet and you need to copy the value above. Now, everyone knows the two ways to do this (copy /paste and to “drag and fill” the data down). Well, I was shown a third way today and thought I’d share it with you.

Simply select the cell where you want the data to be copied into and press CTRL + D (for Duplicate) and that’s it.

Before and After

Piping out to the clipboard

We all know how to pipe out to text files, right ? From a command prompt type in your command followed by > and then the name of the file to output the result to.
 
For example
 
ipconfig /all > c:myfilesipconfigresults.txt
 
will put the results of ipconfig /all into a text file called ipconfigresults.txt in the myfiles folder and the more advanced ones among us know how to not only pipe the command out but also open that text file automatically after the command has completed.
 
For example
 
ipconfig /all > c:myfilesipconfigresults.txt & c:myfilesipconfigresults.txt
 
Well, that leaves a permanent file on your hard drive which you might or might not want. Plus, if you want the text in another file you have to open the text file as above, select it all and then copy it to the clipboard.
 
Now, you can doo all of that in one go without leaving that pesky file behind – just pipe the command to the clipboard !
 
For example
 
ipconfig /all | clip
 
will put the output of the ipconfig / all command on your clipboard. You can now either paste it into notepad for a temporary file or paste it into any more permanent file, as part of producing customer documentation for example.