Bart's Weblog

Just a blog…

Archive for March, 2008

VBScript: Bypass the "Open File – Security Warning" dialog from VbScript

Posted by bartvdw on 3030/0303/2008

You have had it before: the “Open File – Security Warning”. Nice feature, but not very interesting during execution of scripts. However you may not want to turn it off.

The simple solution in VBScript has been offered by MS themselve: the SEE_MASK_NOZONECHECKS environment variable. Change it at the start of your script and restore it at the end. Plain & simple!

Sample code (same as the KB article):
set oShell= CreateObject(“Wscript.Shell”)
set oEnv = oShell.Environment(“PROCESS”)
oEnv(“SEE_MASK_NOZONECHECKS”) = 1
oShell.Run “c:\ms04-038\WindowsXP-KB834707-x86-enu /quiet /passive /norestart”,0,True
oEnv.Remove(“SEE_MASK_NOZONECHECKS”)

The Open File – Security Warning dialog box is displayed when you try to silently install a hotfix or an update by using a Visual Basic script in Windows XP Service Pack 2
http://support.microsoft.com/kb/889815

Advertisements

Posted in Scripting, VBScript | 8 Comments »

Important fix for ePO 3.6.x

Posted by bartvdw on 3030/0303/2008

Recently we had an issue on our ePO 3.6.x servers. In the CMA logs we found “ePO Server reached the maximum download limit”.

After some investigation we found a KB on the McAfee website documenting this related to Apache included in ePO installation.

My advise: apply it if running ePO 3.6.x by default.

ERROR: ePO Server reached the maximum download limit (issue: Apache configuration)
https://knowledge.mcafee.com/SupportSite/search.do?cmd=displayKC&docType=kc&externalId=9227574&sliceId=SAL_Public&dialogID=26664547&stateId=1%200%2026656632

Posted in McAfee | Leave a Comment »

How to identify Microsoft SQL Server version & build…

Posted by bartvdw on 3030/0303/2008

Some time ago I needed to easily find the SQL version & build installed on a machine to identify missing patches. Below the links that will tell you everything you need about this!

Microsoft SQL Server 2008, 2005, 2000 and 7.0 Builds
http://sqlserverbuilds.blogspot.com/

How to identify your SQL Server version and edition
http://support.microsoft.com/kb/321185/

Also some registry keys that could be easy when you write custom scripts.

SQL Server 2005 Express
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion — CurrentVersion — REG_SZ

Posted in SQL | Leave a Comment »

Troubleshooting TCP/IP…

Posted by bartvdw on 1616/0303/2008

This week I had a friend calling that he had no more internet connection. He had already been on the phone with the helpdesk of his ISP, reinstalled NIC, … If I couldn’t take a look before inserting a Windows XP CD and reinstalling the whole system.

When I tried to view the TCP/IP properties, the “Properties” button was greyed out. To the command prompt then! “ipconfig” showed only “Windows IP Configuration”… When I ran the “netdiag” tool, it returned following: “Failed to get information for a network adapter. The error occurred was: The pipe is being closed. <232> [FATAL] Cannot find TCP/IP configuration from the registry”.

OK there was clearly a problem, but what’s the cause and more important: solution? Reinstalling the NIC didn’t solve the problem and reinstalling TCP/IP was something I was willing to do, but I found out that it wasn’t easy to do as it is considered a core component and therefor can’t be removed & added again!

I managed to fix this by applying several actions (and a lot of searching):
1. Reset TCP/IP -> netsh int ip reset <log> (log is needed, ex. “C:\ResetIP.txt”)
2. Reinstall “Internet Protocol (TCP/IP)” -> Add protocol, click on “Have disk…” and browse to “C:\%WinDir%\inf\nettcpip.inf” *
3. Reinstall “Client for Microsoft Networks” -> Remove it first, when you add a Client afterwards, it will show in the list

* For step 2 it is clear that if you have a Windows media available, to use the “nettcpip.inf” located on the media and not the local one as that could be corrupted.

Below some very interesting links that helped me a lot!

How to reset Internet Protocol (TCP/IP) in Windows XP
http://support.microsoft.com/kb/299357

How to troubleshoot TCP/IP connectivity with Windows XP
http://support.microsoft.com/kb/314067

How to reset “Internet Protocol (TCP/IP)” in Windows Server 2003
http://support.microsoft.com/kb/317518

How to determine and to recover from Winsock2 corruption in Windows Server 2003, in Windows XP, and in Windows Vista
http://support.microsoft.com/kb/811259

Windows Server 2003 TCP/IP
http://technet2.microsoft.com/windowsserver/en/technologies/tcpip.mspx

TCP/IP Fundamentals for Windows
http://technet.microsoft.com/en-us/library/cc307741.aspx

Posted in Windows | 3 Comments »

TS Windows 2000/2003: Essential command line utilities

Posted by bartvdw on 1111/0303/2008

I don’t work that much on Terminal Servers, but it happens. Sometimes it has been that long I need to think about the essential command line tools… Here they are!

Command Meaning
change logon Used to disable, enable, or check the status of logons
change port Modify DOS com ports or query for the status of ports
change user Change .ini file mapping for the current user. Applicable change user parameters are install, execute, and query
cprofile Remove user’s profile file associations
flattemp Enable or disable temporary flat directories
logoff End a client session
msg Send a message to a client
mstsc Displays the Remote Desktop Connection to establish a connection with a Terminal Server
query process Display process information
query session Display terminal services session information
query termserver Display terminal server list
query user Display logged on user list with information. Like “who” in UNIX
register Register a program
reset session Reset or delete a terminal session
shadow Monitor or remotely control a terminal service session
tscon Start a Terminal Services session
tsdiscon End a Terminal Services session
tskill Terminate a Terminal Server process
tsprof Change a user profile path or copy user information
tsshutdn Shut down a terminal server

 

HOW TO: Use the RESET SESSION Command to Reset a Session in Windows 2000 Terminal Services
http://support.microsoft.com/kb/320192

HOW TO: Use the TSSHUTDN Command to Shut Down a Terminal Server in Windows 2000 Terminal Services
http://support.microsoft.com/kb/320188

HOW TO: Clean Profiles By Using the Cprofile Command in Terminal Services
http://support.microsoft.com/kb/320186

HOW TO: Disconnect a Session by Using the TSDISCON Command in Windows 2000 Terminal Services
http://support.microsoft.com/kb/321705

HOW TO: Use the TSKILL Command to End Processes in Windows 2000 Terminal Services
http://support.microsoft.com/kb/320052

HOW TO: Turn Off Logons to a Terminal Server By Using the CHANGE LOGON Command in Windows 2000
http://support.microsoft.com/kb/320183

HOW TO: Register Programs to Run in a Global Context by Using the REGISTER Command in Windows 2000 Terminal Services
http://support.microsoft.com/kb/321701

HOW TO: Use the SHADOW Command to Remotely Monitor an Active Session of Another User in Windows 2000 Terminal Services
http://support.microsoft.com/kb/320191

HOW TO: Change COM Port Mappings by Using the CHANGE PORT Command in Windows 2000 Terminal Services
http://support.microsoft.com/kb/320184

HOW TO: Connect to Another Session by Using the TSCON Command in Windows 2000 Terminal Services
http://support.microsoft.com/kb/321703

Windows 2000 Terminal Services Session Management Tools
http://support.microsoft.com/kb/243202

Managing Terminal Services from the command line
http://technet2.microsoft.com/windowsserver/en/library/1db49727-f587-424d-8d98-bb51630d13a01033.mspx?mfr=true

Posted in Windows | Leave a Comment »