Showing posts with label Tricks. Show all posts
Showing posts with label Tricks. Show all posts

Folder Redirection in Windows Vista


Folder redirection refers to the redirection of user folders such as Documents, Pictures, Start Menu and Desktop. While in Windows XP, only five folders could be redirected, Vista allows ten folders. Folder redirection is intended to replace the older concept of having a "home folder" for users. The problem with this (and most of us Admins still face this with users) is that there are too many applications that do not allow you to specify a default path for storing data files and users simply accept the default ending up with some files on the network, some in their [potentially roaming] profile and some on the local system.

Folder redirection supports two modes: Basic and Advanced. Basic redirection sends everyone’s folders to the same location and creates special subfolders for each user while advanced lets you to set folder redirection paths for specific groups.

You're probably aware this can be controlled via Group Policy in a corporate environment, but it is actually very easy to use at home as well. Backups are much easier when your data is separated from the local machine. If you don't have a server or network attached storage device at home, you could also redirect folders to a second (removable/USB) drive. It is actually as simple as moving the desired folder from where it is to where you want it to be! All references by the system will dynamically be updated to reference the new location.

Move or Cut and paste any of the following folders to take advantage of this feature for your computer at home.

WMI Control in Windows Vista

WMI (Windows Management Instrumentation) offers a ton of data about a Windows computer. It is a open database of information that Microsoft and others populate with virtually all details regarding your system. While management software can (and often does) take advantage of this data collection, it is also very easy to get at this information from scripts.

There are a number of WMI script generators out there including Microsoft’s Script-O-Matic and other copycat tools. One worth mentioning is provided as the “WMI Wizard” in the “Admin Script Editor” (www.adminscripteditor.com) tool. A couple of unique things it does includes generating script code in PowerShell, VBScript, KiXtart or AutoIt scripting languages and showing sample values for selected properties. The latter is important because while you may see something that looks like just what you want when browsing about, all too often the value is either unpopulated or unfriendly (unreadable that is). The feature is fully functional in the 45 day trial available for download.

You can control WMI from the WMI Control snap-in in the MMC.

1) Hit the “Start” button, type MMC and hit enter
2) If you have UAC enabled, you’ll have to answer the prompt that this is okay to run
3) Under file click “Add/Remove Snapin…” and then choose the WMI Control snapin at the bottom of the list provided.
4) You’ll be given the option to manage this on your local system or a remote one (I choose local)
5) Unlike many MMC snapins this is actually a separate dialog so all you get in the tree is a single node with no child nodes. Right click it and choose “Properties” to get at its settings.

The general tab shows you some basic information pulled from WMI regarding your system. Probably nothing you didn’t know here. The Backup/Restore tab lets you do as you’d expect. With the Security tab we finally get to something interesting. Here you can specify security on any level similar to how you would on most other items such as files and folders. Finally, there is an “Advanced” tab which has but one setting and that is to allow for you to specify the default namespace for purposes of scripting. This is set to root\cimv2 by default and is not something you would normally change as this is where most of the classes exist that pertains to your system. With this set, you need not specify the full path to the namespace when referencing a class as in the example below.

PowerShell:

foreach ($wmiColl in Get-WmiObject Win32_BIOS *){
Write-Output ("SerialNumber: " + $wmiColl.SerialNumber)
}

In the above example I’m just getting the Asset Tag code from the system BIOS. All data returned from WMI is provided as a collection, so even when you know there is one result it is necessary to address it this way. For example if you were looking for drive information, each collection would provide information on a different drive and there could be any number of drives returned depending on the system. Here it makes sense, but just keep in mind the rule is the same for when you know there is only one response

System Configuration:Command line Tools in Windows Vista

The "Tools" tab of the system configuration applet offers shortcuts to a number of helpful tools and shows you the path and filename for each:

About Windows
C:\Windows\system32\winver.exe

System Information
C:\Windows\System32\msinfo32.exe

Remote Assistance
C:\Windows\System32\msra.exe

System Restore
C:\Windows\System32\rstrui.exe

Computer Management
C:\Windows\System32\compmgmt.msc

Event Viewer
C:\Windows\System32\eventvwr.exe

Programs
C:\Windows\System32\appwiz.cpl

Security Center
C:\Windows\System32\wscui.cpl

System Properties
C:\Windows\System32\control.exe system

Internet Options
C:\Windows\System32\inetcpl.cpl

Internet Protocol Configuration
C:\Windows\System32\perfmon.exe

Performance Monitor
C:\Windows\System32\cmd.exe /k %windir%\system32\ipconfig.exe

Task Manager
C:\Windows\System32\taskmgr.exe

Disable UAC
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

Enable UAC
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

Command Prompt
C:\Windows\System32\cmd.exe

Registry Editor
C:\Windows\System32\regedt32.exe