MGSoft-Net's Tips Help and FAQ

Windows Tips and HowTo

Change Proxy Settings in Registry (Grant)

Use this to keep users from changing proxy settings in IE or Firefox [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "ProxyEnable"=dword:00000001 "ProxyServer"="172.16.0.1:3128" Check out that registry key, thats all you'll have to do
You can also save the file, and then rename it to a .reg file. You then will simply double-click the file to set their proxy server setting to whatever value you enter in the "proxyserver"= spot

Blackberry Email Problems, Blackberry email validation (Grant)
If you come across an error with Blackberry that it can not "validate user account", you need to re validate it. This could be caused by user account email password change, account lock-out, etc.
Go to Email setup wizard on the blackberry, log in to account. Select Edit, and the account should be there. If it is a validation issue, it will say that it is not valid and there will be an option to re validate it. If you need to change the password you can do it here as well.
Sounds played on PC, How to fix sounds played on a PC (Grant)
If someone's PC plays songs/sounds that they don't want, follow these instructions. This is also good if you want to play a joke too. Don't worry about Outlook, it works for other programs as well. In Control Panel, click Sounds, Speech, and Audio Devices, and then click Sounds and Audio Devices. Note If you are using Classic view in Control Panel, double-click Sounds and Audio Devices. Click the Sounds tab. Under Program Events, under Windows, select New Mail Notification. Microsoft Windows 2000 In Control Panel, double-click Sounds and Multimedia. On the Sounds tab, under Sound Events, under Windows, select New Mail Notification. Click Browse, and then select a new .wav audio file. Click OK. Note The audio file can be located anywhere on your hard disk or network share that you always have access to. If you move the audio file or if the file is not accessible for any reason, the sound will not play.
SQL Server Express Backup (Farouk)
As some of us might know Microsoft SQL Sever Express does not come with any backup utility. To set up a scheduled daily backup up these are the steps you should take.
1. Make a new folder on drive C: called "Backup" than Download, Install and Configure the free Sql Management Utility from Microsoft.
2. In the Management Utility, right click on the database you wish to back up and choose back up. Click on the script button and the utility will write a SQL script for you and it should look like this CODE BACKUP DATABASE [AyaNova] TO DISK = N'C:\Backup\AyaNova.bak' WITH NOFORMAT, NOINIT, NAME = N'AyaNova-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, Stats =10 GO In this cases "Ayanova" is the name of my database. You need to substitute with the name of your database you wish to back up.
3. Save this SQL script as C:\backup.sql 4. Next write a batch file in sql and save it on C:\backup.bat. The batch file should look like this CODE sqlcmd -i c:\backup.sql -o c:\output.txt sqlcmd -S SERVER01\SQLEXPRESS -i backup.sql -o output.txt In this code the -S has to be in uppercase and substitute SERVER01 with the name of your server where the SQLExpress database resides.
5. Now open Task Scheduler and schedule to run backup.bat everyday. This should back up your database to C:\Backup Access 2000 Not Conneting to server (Farouk) This fix is for access not being able to connect to the database on server after installing IE 7. Open up IE and go to the Tools --> Internet Option. Under the Security Tab choose Local Intranet and click on the Sites button. A window will pop up--> Uncheck "Automatically detect intranet network" Click on OK and Apply. This should fix the problem, Farouk
SQL Server Backup and Null (Grant)
SQL Server has a backup utility. It will back up to the C: drive (or where ever), and continuously grow. To restore a backup in SQL server, take the database file offline, make a backup of the MDF and LDF files (c:\prog..file\sqlserver\mssql\data\ ) then use restore, it should auto point to the back up file, and then select the date you want. Make sure that you rename the restore file or it will overwrite. Also check the restore MDF and LDF files that they are renamed (should be by default). To insert NULL fields into SQL server, use CTRL 0 and it will put in a null.
Outlook out of office fix
You may run into a situation when a user can not turn on/off the out of office feature in outlook. When they do, they get a message "feature is not available - read documentation" or something to that effect. To fix, follow these steps: # Open Outlook.
# Click on Tools.
# Click on About Microsoft Outlook.
# Click on the Disabled Items entry.
# You will see a Disabled Items window open, with the following information within it:
The items below were disabled because they prevented Outlook from functioning correctly. Please note that you may have to restart Outlook for these changes to take place. Select the ones you wish to re-enable

Programming and Linux Tips and HowTo

This is a to terminate a program in the Windows Process.
'Close A Program
'set variables Set wshshell = wscript.createobject("wscript.shell")
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Program-Name-here.exe'")
For Each objProcess in colProcessList objProcess.Terminate()
This script is to delete files that are older than 7 days
CODE Dim fso, f, fl, fc, s, folderdel, diff
'Change folder path to delete here folderdel = "C:\Name of Folder\Folder\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderdel)
Set fc = f.Files
For each fl in fc
diff = date - fl.datelastmodified
'You can change how old the files should be here.
if diff > 7 then
wscript.echo fl.name & " deleted"
fl.delete
end if
String in VB script to change File name
wshshell.SendKeys "\\Server Name\ACT! Database\ACT! Backup\c3controls-" & Replace(FormatDateTime(Date(),2), "/","") & ".zip"
This will save the file as c3controls-(Todays Date)
A simple .bat file that open a program called ACT!
cd\ cd..
cd..
cd "Program Files"
cd "ACT"
cd "ACT for Windows"
ActRunner.exe
exit
Here are a list of Keys and their corresponding Windows VBScript code:
Key------------------------------------------------- Code

BACKSPACE ----------------------------------{BACKSPACE}, {BS}, {BKSP}
BREAK -----------------------------------------{BREAK}
CAPS LOCK------------------------------------{CAPSLOCK}
DELETE ----------------------------------------{DELETE}, {DEL}
DOWN ARROW---------------------------------{DOWN}
END----------------------------------------------{END}
ENTER------------------------------------------{ENTER} or ~
ESC--------------------------------------------{ESC}
HELP-------------------------------------------{HELP}
HOME------------------------------------------{HOME}
INSERT----------------------------------------{INSERT}, {INS}
LEFT ARROW----------------------------------{LEFT}
NUM LOCK-------------------------------------{NUMLOCK}
PAGE DOWN----------------------------------{PGDN}
PAGE UP--------------------------------------{PGUP}
PRINT SCREEN-------------------------------{PRTSC}
RIGHT ARROW-------------------------------{RIGHT}
SCROLL LOCK--------------------------------{SCROLLLOCK}
TAB--------------------------------------------{TAB}
UP ARROW------------------------------------{UP}
F1 to F16--------------------------------------{F1} to {F16}
SHIFT------------------------------------------+
CTRL-------------------------------------------^
ALT---------------------------------------------%
To specify that any combination of SHIFT, CTRL and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. i.e. To specify to hold down SHIFT while E and C are pressed , use "+(EC)" {LEFT 42} means press the LEFT ARROW key 42 times {h 10} means press H 10 times.

To Minimize front active screen:
Alt - Spacebar -n
This will work for any program you want to minimize. However, note that command prompt does not accept sendkeys.
SAMBA Setup instruction
Here is a quick way to set up a SAMBA server to be a Domain Controller – just for user authentication – no shares on the server. SAMBA Setup Instructions, first on the linux server, make sure you have Samba installed (rpm or however):
IP: 10.x.x.2 – set to whatever you want this should be done during Linux installation
Domain: domainname
Hostname: linuxsamba
Samba Domain: sambadomain (always make different!)
NETLOGIN folder – needed for windows logins – create a folder and set it to non-writeable and not public:
/usr/local/samba/netlogin or
/var/lib/samba/netlogin – I think is there by default
SMB.CONF file location:
/etc/samba
*save a copy, then open file in text editor – delete everything! Then type in:
[global]
workgroup = sambadomain -- your domain name here
logon path = -- this disables windows roaming profiles
domain logons = Yes --
os level = 65 -- this ensures browse master winner
preferred master = Yes --
domain master = Yes --
security = user -- users must authenticate
local master = yes --
[netlogon] -- need this for domain logins
comment = The domain logon service
path = /usr/local/samba/netlogon
public = no
writeable = no
Save and close.
Hosts File Location: /etc/hosts -- *if needed and if you want to edit
Make users: -need to add to Linux and then to Samba, use Terminal Console to do this:
Useradd –d /home/null –s /home/null ntuser (creates user with no home directory – good for pdc w/no shares)
Smbpasswd –a ntuser (creates the samba user and will prompt for password, win ctrl-alt-del will change)
Smbpasswd –e ntuser (enables the user)
/etc/init.d/smb restart
/etc/init.d/nmb restart --restart services
Add machine accounts – do this for windows machines – will not add automatically
Useradd –s /bin/false –d /var/lib/nobody ntmachine\$ (\$ tells unix it’s a pc, /dev/no io /var/lib sometimes)
Smbpasswd –a –m ntmachine (tells it’s a machine to samba and no password)
smbpasswd file location = /usr/local/samba/smbpasswd
EDIT smb.conf directly, use above. Don’t configure with SWAT or Webmin – unless sure of it.
On member server (win2k) to add a Samba User to administrator group (user: Admin) – MMC-Manage Computer, local users and groups, groups, administrators – ADD
– select domain (if need user/pass then make a new Linux+Samba account called Administrator and put it in the Root group – use YAST to do this), //domain/Administrator – choose Admin and put into local Administrator group. Log off and in.
If create a share directory in SWAT then drop the / in front of the file name, /sharename should be sharename
(only in the path option use the /)
Make sure if using linux firewall to have added in: 137, 139, 445 tcp/udp open ports in /etc/services. I would turn off the firewall while testing.
This should give you a working PDC!