MSSQL Table Reindex
Use this single line command to re-index every table in a Microsoft SQL Server database:
EXEC sp_msForEachTable
@COMMAND1 = 'DBCC DBREINDEX ("?")'
Use this single line command to re-index every table in a Microsoft SQL Server database:
EXEC sp_msForEachTable
@COMMAND1 = 'DBCC DBREINDEX ("?")'
One of the cool features of FireFox for the linguistics challenged like me is that it will spell check items in a textarea of a web page. If you misspell it, there is little red line that shows under the word and you can right mouse click on it and select the correct spelling of that word. The problems for me is that I get a little too quick on my clicking and from time to time, select the Add To Dictionary option which is directly under the list of other options for the word you misspelled.
To clear the word from the custom dictionary you need to find the persdict.dat and open it in a text editor and removed the wrong entry. On Windows XP you will find it in C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\unique.default And on Mac OS X it is located at /Library/Application Support/Firefox/Profiles/unique.default
Ever need to run a command line utility on a remote Windows machine?
Make sure you have PSTools installed on the workstation you are working from.
From your command line type:
psexec \\nameOfRemote cmd.exe
You will now have a command line interface on the remote workstation.
In our Active Directory domain we do not allow the clients to resolve outside domain names. This is because we have a very restrictive web browsing policy and people are only allowed access out if a manager says they can, and even at that point it goes through a proxy server that blocks 99% of the internet. The added benefit is that this really curbs any virus or spyware issues. Even though we don’t let user workstations out of the network, there are other vlans that definitely need out. At the time we were very limited on the number of Windows servers we could purchase and place so we went with Linux to provide this name server for these vlans. Below is the config and how resolve both internal and external names and I will describe what each section involves.
Line 6-14 list the subnets that are allowed access to this name server. If you are not in this subnet and you request a name resolution from this server, you will be denied.
Line 18-21 lists the name servers for outside (internet) name resolution. These are the OpenDNS ip addresses.
Line 25-33 tells named that for the domain ‘domain.com’ resolve those names to the internal Active Directory DNS servers.
Line 35-55 lists the zones for reverse name resolution. These zone names must match the reverse name in your AD DNS servers.
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
version "not currently available";
allow-query {
127.0.0.1;
10.1.4.0/24;
10.1.6.0/24;
10.1.7.0/24;
10.1.15.0/24;
10.2.4.0/24;
10.2.7.0/24;
};
allow-transfer {
none;
};
forwarders {
208.67.220.220;
208.67.222.222;
};
forward only;
};
zone "domain.com" IN {
type forward;
forwarders {
10.1.100.100;
10.1.101.101;
10.2.100.100;
10.2.101.101;
};
};
zone "1.10.in-addr.arpa" {
type slave;
file "slaves/1.10.in-addr.arpa";
masters {
10.1.100.100;
10.1.101.101;
10.2.100.100;
10.2.101.101;
};
};
zone "2.10.in-addr.arpa" {
type slave;
file "slaves/2.10.in-addr.arpa";
masters {
10.1.100.100;
10.1.101.101;
10.2.100.100;
10.2.101.101;
};
};
include "/etc/rndc.key";
I had pushed out Office 2007 using a GPO start up script with a custom .msp file to tweak the install the way we wanted it. The problem is that when it was originally installed we had Exchange 2003 server and now we have moved to Exchange 2007 with completely different server names. Since we had put in the server names in the .msp file, Outlook will now only look for those no existent Exchange 2003 servers. It’s default function is to query AD and find the Exchange 2007 server that hosts that user’s mailbox. So to fix this problem I have to uninstall the current install of Office 2007 and re-push it so we have a consistent install from all old installs and all future fresh installs.
So here is what I have done. Created a new .bat file for a new Office 2007 install GPO. Below is the script for checking for version/uninstall/install of Office.
@ECHO OFF
setlocalREM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************REM Get ProductName from the Office product’s core Setup.xml file.
set ProductName=ProPlusREM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\domain.com\dfs\AdminInstall\Microsoft\off2007REM Set AdminFile to the custom MSP file
set AdminFile=\\domain.com\dfs\AdminInstall\Microsoft\off2007\UpdatesREM Set LogLocation to a central directory to collect log files.
set LogLocation=\\domain.com\dfs\AdminInstall\Microsoft\off2007\Office12LogsREM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************IF NOT “%ProgramFiles(x86)%”==”" SET WOW6432NODE=WOW6432NODE\
reg query HKEY_LOCAL_MACHINE\SOFTWARE\%WOW6432NODE%Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if %errorlevel%==1 (goto DeployOffice) else (goto CheckReinstall)REM If 1 returned, the product was not found. Run setup here.
eployOffice
echo %date% %time% > c:\Office2007.txt
echo Installation of Office 2007 has begun. >> c:\Office2007.txt
start /wait %DeployServer%\setup.exe /adminfile %AdminFile%REM echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
REM if office is installed check to see if it has already been uninstalled.
:CheckReinstall
if exist c:\Office2007.txt goto Endecho %date% %time% > c:\Office2007.txt
echo Uninstall of Office 2007 has begun!
start /wait %DeployServer%\setup.exe /uninstall ProPlus /config \\domain.com\dfs\AdminInstall\Microsoft\off2007\ProPlus.WW\SilentUninstall.xml
echo %date% %time% Uninstall ended with error code %errorlevel%. >> c:\Office2007.txtREM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:EndEndlocal
The way this script works is as follows:
Check to see if the registry has entries for Office, if nothing in the registry create a file c:\Office2007.txt and start the install. This takes care of all new and future installs of Office.
If there is a registry entry, check to see if the file c:\Office2007.txt exists. If not, this means it is an old broken install and it is then uninstalled. At the end of uninstall the machine automatically reboots.
When the machine starts again, there is nothing in the registry so the new installation starts.
All future reboots will see that both a registry entry and the c:\Office2007.txt exists and it will dump out of the script.
I setup a temp OU and moved a department at a time into the new OU. This is done so that the entire company is not reinstalling Office at the exact same time, causing a slow down and possibly raising a large number of support calls to the IS Department.
I finally took the time to disable this annoying trait of XP. Anytime a new user logs onto a workstation they would have that annoying XP tour pop up in the task tray and you would have to run it once to make it keep from coming back each time the user logged in.
So here is the KiXtart code to make it never show up.
; Turn off XP tour on first logon
$ReturnCode = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour", "RunCount", "0", "REG_DWORD")
We don’t run the Windows Desktop Search tool and when you launch Outlook 2007 it prompts you with the following message;
“Windows Desktop Search is not currently installed or not up to date. Outlook will not be able to provide fast search results when using the new Instant Search functionality unless this Windows component is installed.”
Not wanting the userbase to see this message, added this line to the KiXtart logon to make it automatically disabled.
; OUTLOOK 2007 - turn off prompt to download Desktop Search
$ReturnCode = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\General", "PONT_STRING", "60", "REG_SZ")
We are in the process of rolling out IE 7 and Outlook 2007 to all our workstations. Ran into a few things that were annoying so here is how they are now fixed up.
After you install IE7 there is that annoying Language Bar that shows up in the task bar next to the clock. Since we don’t use this thing and it confuses our users and we don’t want to field all the calls of freaked out users wondering what this thing is, we disable it.
Since we use KiXtart as our logon scripting language I will give you the syntax for that, but it is just registry entries so you can use the same thing with what ever tools you use to push out registry changes.
; Turn off Language Bar
$ReturnCode = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\CTF\LangBar", "ShowStatus", "3", "REG_DWORD")
$ReturnCode = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\CTF\LangBar", "ExtraIconsOnMinimized", "0", "REG_DWORD")
$ReturnCode = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\CTF\MSUTB", "DontShowCloseLangBarDlg", "1", "REG_DWORD")
$ReturnCode = DelValue("HKEY_CURRENT_USER\Software\Microsoft\CTF\MSUTB", "ShowDeskBand")
While funny, I can’t say these spots make me warm and fuzzy about Vista. Vista still sucks donkey, technically speaking that is. Maybe they shouldn’t waste time and money on silly commercial about shoes, and write a good operating system with that time and money.
Wanted to try out the new browser but it is a Windows only thing! Crap, oh well I guess I will keep using Firefox on my Mac.