Showing posts with label Sysadmin. Show all posts
Showing posts with label Sysadmin. Show all posts

Tuesday, 23 November 2010

Sysadmin: Using telnet to send emails, emails without clients

Open new cmd window.
Type the following:

telnet hostname portnumber e.g. telnet 10.11.11.11 25
helo
mail from: a@a.com
rcpt to: a@a.com
DATA

quit

Thursday, 11 November 2010

Sysadmin: Run Shortcuts

XP Run Command List:


To Access… Run Command
Accessibility Controls access.cpl
Accessibility Wizard accwiz
Add Hardware Wizard hdwwiz.cpl
Add/Remove Programs appwiz.cpl
Administrative Tools control admintools
Adobe Acrobat (if installed) acrobat
Adobe Designer (if installed) formdesigner
Adobe Distiller (if installed) acrodist
Adobe ImageReady (if installed) imageready
Adobe Photoshop (if installed) photoshop
Automatic Updates wuaucpl.cpl
Bluetooth Transfer Wizard fsquirt
Calculator calc
Certificate Manager certmgr.msc
Character Map charmap
Check Disk Utility chkdsk
Clipboard Viewer clipbrd
Command Prompt cmd
Component Services dcomcnfg
Computer Management compmgmt.msc
Control Panel control
Date and Time Properties timedate.cpl
DDE Shares ddeshare
Device Manager devmgmt.msc
Direct X Control Panel (if installed)* directx.cpl
Direct X Troubleshooter dxdiag
Disk Cleanup Utility cleanmgr
Disk Defragment dfrg.msc
Disk Management diskmgmt.msc
Disk Partition Manager diskpart
Display Properties control desktop
Display Properties desk.cpl
Display Properties (w/Appearance Tab Preselected) control color
Dr. Watson System Troubleshooting Utility drwtsn32
Driver Verifier Utility verifier
Event Viewer eventvwr.msc
Files and Settings Transfer Tool migwiz
File Signature Verification Tool sigverif
Findfast findfast.cpl
Firefox (if installed) firefox
Folders Properties folders
Fonts control fonts
Fonts Folder fonts
Free Cell Card Game freecell
Game Controllers joy.cpl
Group Policy Editor (XP Prof) gpedit.msc
Hearts Card Game mshearts
Help and Support helpctr
HyperTerminal hypertrm
Iexpress Wizard iexpress
Indexing Service ciadv.msc
Internet Connection Wizard icwconn1
Internet Explorer iexplore
Internet Properties inetcpl.cpl
Internet Setup Wizard inetwiz
IP Configuration (Display Connection Configuration) ipconfig /all
IP Configuration (Display DNS Cache Contents) ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents) ipconfig /flushdns
IP Configuration (Release All Connections) ipconfig /release
IP Configuration (Renew All Connections) ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS) ipconfig /registerdns
IP Configuration (Display DHCP Class ID) ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID) ipconfig /setclassid
Java Control Panel (if installed) jpicpl32.cpl
Java Control Panel (if installed) javaws
Keyboard Properties control keyboard
Local Security Settings secpol.msc
Local Users and Groups lusrmgr.msc
Logs You Out Of Windows logoff
Malicious Software Removal Tool mrt
Microsoft Access (if installed) msaccess
Microsoft Chat winchat
Microsoft Excel (if installed) excel
Microsoft Frontpage (if installed) frontpg
Microsoft Movie Maker moviemk
Microsoft Paint mspaint
Microsoft Powerpoint (if installed) powerpnt
Microsoft Word (if installed) winword
Microsoft Syncronization Tool mobsync
Minesweeper Game winmine
Mouse Properties control mouse
Mouse Properties main.cpl
Nero (if installed) nero
Netmeeting conf
Network Connections control netconnections
Network Connections ncpa.cpl
Network Setup Wizard netsetup.cpl
Notepad notepad
Nview Desktop Manager (if installed) nvtuicpl.cpl
Object Packager packager
ODBC Data Source Administrator odbccp32.cpl
On Screen Keyboard osk
Opens AC3 Filter (if installed) ac3filter.cpl
Outlook Express msimn
Paint pbrush
Password Properties password.cpl
Performance Monitor perfmon.msc
Performance Monitor perfmon
Phone and Modem Options telephon.cpl
Phone Dialer dialer
Pinball Game pinball
Power Configuration powercfg.cpl
Printers and Faxes control printers
Printers Folder printers
Private Character Editor eudcedit
Quicktime (If Installed) QuickTime.cpl
Quicktime Player (if installed) quicktimeplayer
Real Player (if installed) realplay
Regional Settings intl.cpl
Registry Editor regedit
Registry Editor regedit32
Remote Access Phonebook rasphone
Remote Desktop mstsc
Removable Storage ntmsmgr.msc
Removable Storage Operator Requests ntmsoprq.msc
Resultant Set of Policy (XP Prof) rsop.msc
Scanners and Cameras sticpl.cpl
Scheduled Tasks control schedtasks
Security Center wscui.cpl
Services services.msc
Shared Folders fsmgmt.msc
Shuts Down Windows shutdown
Sounds and Audio mmsys.cpl
Spider Solitare Card Game spider
SQL Client Configuration cliconfg
System Configuration Editor sysedit
System Configuration Utility msconfig
System File Checker Utility (Scan Immediately) sfc /scannow
System File Checker Utility (Scan Once At The Next Boot) sfc /scanonce
System File Checker Utility (Scan On Every Boot) sfc /scanboot
System File Checker Utility (Return Scan Setting To Default) sfc /revert
System File Checker Utility (Purge File Cache) sfc /purgecache
System File Checker Utility (Sets Cache Size to size x) sfc /cachesize=x
System Information msinfo32
System Properties sysdm.cpl
Task Manager taskmgr
TCP Tester tcptest
Telnet Client telnet
Tweak UI (if installed) tweakui
User Account Management nusrmgr.cpl
Utility Manager utilman
Windows Address Book wab
Windows Address Book Import Utility wabmig
Windows Backup Utility (if installed) ntbackup
Windows Explorer explorer
Windows Firewall firewall.cpl
Windows Magnifier magnify
Windows Management Infrastructure wmimgmt.msc
Windows Media Player wmplayer
Windows Messenger msmsgs
Windows Picture Import Wizard (need camera connected) wiaacmgr
Windows System Security Tool syskey
Windows Update Launches wupdmgr
Windows Version (to show which version of windows) winver
Windows XP Tour Wizard tourstart
Wordpad write

Friday, 18 June 2010

Tuesday, 15 December 2009

Sysadmin: cURL

Found a very powerful commandline tool for transferring data across a multitude of protocols.
"curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction."
http://curl.haxx.se/

Thursday, 5 November 2009

Windows 7: System crashed, lost administrative privileges to exfat drive

I'm running Windows 7 RTM, computer just crashed an hour ago and have noticed that I've lost write access to my D drive formatted in exFat, what gives??

Seems like the entire partition has been reset with a readonly flag.

Seen a couple of solutions on the net.

Try running a new command window in elevated mode, change to drive and run "chkdsk /f".

Or try using diskpart > select disk xx > select vol xx > att vol clear readonly

The diskpart didn't work for me, but chkdsk worked!! Sigh... haven't had to do chkdsk since windows98.

Monday, 10 August 2009

IIS: Resyncing Anonymous User Account Password

This error can occur if the password for the user account that is used for anonymous access in IIS is not synchronized with one of the following passwords:
  • The password for the user account in Active Directory
  • The password for the user account in Local Users and Groups
To synchronize the IIS password with the password that is used in Active Directory or in Local Users and Groups, follow these steps:

1. Click Start, click Run, type cmd, and then click OK.

2. Use the cd command to connect to the folder where the Adsutil.vbs file is located. By default, the Adsutil.vbs file is located in the following folder:
drive:\Inetpub\Adminscripts
Note drive is the folder where Windows is installed.

3. At the command prompt, type Cscript adsutil.vbs get w3svc/anonymoususerpass, and then press ENTER. Note the password that is generated.

Note You may have to set the Issecure property in the Adsutil.vbs file to False before you generate a password. To do this, follow these steps:

a. In Notepad, open the Adsutil.vbs file.
b. On the Edit menu, click Find, type IsSecureProperty = True, and then click Find Next.
c. Change “IsSecureProperty = True” to “IsSecureProperty = False”.
d. Save the changes, and then close Notepad.

4. Click Start, click Run, type Dsa.msc, and then click OK.

Note If the Web server is a stand-alone server, type Lusrmgr.msc.

5. Expand the domain that you want, and then click Users. If the Web server is a stand-alone server, click Users.

6. Right-click the user account that you want, and then click Reset Password or Set Password.

7. Type the password that you obtained in step 3 two times, and then click OK.

http://support.microsoft.com/kb/909887

Wednesday, 29 April 2009

Sysadmin: Replace comma with linebreak character

In Microsoft Word:

1. Select: Edit/Find then go to the Replace tab. On that screen, you may have to press the button that says "More"

2. Click onto the Find What field, then click the "Special" Button at the bottom of the Window. Select "White Space."

3. Click onto the Replace with field, then click "Special" Button again. This time, select "Paragraph Mark."

4. Click the "Replace All" Button. The job is done.

Thursday, 8 January 2009

Sysadmin: Free Busy Http Request

http://[exchange server]/public/?cmd=freebusy&start=2009-01-08T07:00:00&end=2009-01-08T17:00:00&interval=30&u=SMTP:[email address]

Output:

<a:response xmlns:a="WM">
<a:recipients>
<a:item>
<a:displayname>All Attendees</a:displayname>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
<a:item>
<a:displayname>Joe Blogs</a:displayname>
<a:email type="SMTP">jb@jb.com.au</a:email>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
</a:recipients>
</a:response>

Response results are broken into half hour timeslots from 7 AM to 5 PM.
These half hour slots return a single integer.

0 means Free
1 means Tentative
2 means Busy
3 means Out of Office
4 means Unable to find you in exchange dude!

Sunday, 4 January 2009

Sysadmin: Standby System using command line

In the run window type:

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

Friday, 21 November 2008

Sysadmin: FTP scripts


@echo off
setlocal

::---------------------------------
:: Start Logging
::---------------------------------

set logfile="C:\_Job_Import_Export\EC\FTP Log\ECLicence.Log"

::---------------------------------
:: Setup Variables
::---------------------------------

set f=%temp%\ftpc.txt

::---------------------------------
:: Compose ftp commands file
::---------------------------------

echo open 192.168.0.1>>%f%
echo user username password>>%f%
echo binary>>%f%
echo cd _job_import_export>>%f%
echo cd "EC">>%f%
echo mput "C:\data\location\*.csv">>%f%
echo bye>>%f%

::---------------------------------
:: Execute ftp command
:: Use "-d" key for verbose output
:: Use "-i" key no interactive mode
::---------------------------------

echo ------------------------>>%logfile%
echo %date% %time% : Start FTP job>>%logfile%
echo ------------------------>>%logfile%
ftp -n -d -i -s:%f% >> %logfile%

::---------------------------------
:: Cleanup temp script
::---------------------------------

del /f /q %f%

::---------------------------------
:: %date% %time% : Backup files
::---------------------------------

L:
cd\
cd "data\location"
echo ------------------------>>%logfile%
echo %date% %time% : Backing Up Files>>%logfile%
echo ------------------------>>%logfile%
move *.csv "backups">>%logfile%
echo ------------------------>>%logfile%
echo %date% %time% : Job Completed>>%logfile%
echo ------------------------>>%logfile%
echo =-=-=-=-=-=-=-=-=-=-=-=->>%logfile%

endlocal

Tuesday, 9 September 2008

Sysadmin: FTP Commands

List of FTP commands for the Microsoft command-line FTP client

Command-line options

As you're starting the program from a DOS prompt:
ftp [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [computer]

  • -v - Suppresses verbose display of remote server responses.
  • -n - Suppresses auto-login upon initial connection.
  • -i - Turns off interactive prompting during multiple file transfers.
  • -d - Enables debugging, displaying all ftp commands passed between the client and server.
  • -g - Disables filename globbing, which permits the use of wildcard chracters in local file and path names.
  • -s:filename - Specifies a text file containing ftp commands; the commands will automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).
  • -a - Use any local interface when binding data connection.
  • -w:windowsize - Overrides the default transfer buffer size of 4096.
  • computer - Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last parameter on the line.

Client commands

  • ! - Runs the specified command on the local computer
  • ? - Displays descriptions for ftp commands
  • append - Appends a local file to a file on the remote computer
  • ascii - Sets the file transfer type to ASCII, the default
  • bell - Toggles a bell to ring after each file transfer command is completed (default = OFF)
  • binary - Sets the file transfer type to binary
  • bye - Ends the FTP session and exits ftp
  • cd - Changes the working directory on the remote computer
  • close - Ends the FTP session and returns to the command interpreter
  • debug - Toggles debugging (default = OFF)
  • delete - Deletes a single file on a remote computer
  • dir - Displays a list of a remote directory's files and subdirectories
  • disconnect - Disconnects from the remote computer, retaining the ftp prompt
  • get - Copies a single remote file to the local computer
  • glob - Toggles filename globbing (wildcard characters) (default = ON)
  • hash - Toggles hash-sign (#) printing for each data block transferred (default = OFF)
  • help - Displays descriptions for ftp commands
  • lcd - Changes the working directory on the local computer
  • literal - Sends arguments, verbatim, to the remote FTP server
  • ls - Displays an abbreviated list of a remote directory's files and subdirectories
  • mdelete - Deletes one or more files on a remote computer
  • mdir - Displays a list of a remote directory's files and subdirectories
  • mget - Copies one or more remote files to the local computer
  • mkdir - Creates a remote directory
  • mls - Displays an abbreviated list of a remote directory's files and subdirectories
  • mput - Copies one or more local files to the remote computer
  • open - Connects to the specified FTP server
  • prompt - Toggles prompting (default = ON)
  • put - Copies a single local file to the remote computer
  • pwd - Displays the current directory on the remote computer (literally, "print working directory")
  • quit - Ends the FTP session with the remote computer and exits ftp (same as "bye")
  • quote - Sends arguments, verbatim, to the remote FTP server (same as "literal")
  • recv - Copies a remote file to the local computer
  • remotehelp - Displays help for remote commands
  • rename - Renames remote files
  • rmdir - Deletes a remote directory
  • send - Copies a local file to the remote computer (same as "put")
  • status - Displays the current status of FTP connections
  • trace - Toggles packet tracing (default = OFF)
  • type - Sets or displays the file transfer type (default = ASCII)
  • user - Specifes a user to the remote computer
  • verbose - Toggles verbose mode (default = ON)

Monday, 25 August 2008

Sysadmin: AT scheduling command

A schedule to run a batch file at 0:30 AM each day Monday to Sunday.

at 00:30 /every:M,T,W,Th,F,S,Su "e:\Constant_bak.bat"

Inside batch file, it copies a file and backs it up.

copy \\ebnews99\e$\constants.asp \\ebnews99\e$\constants_bak.asp

Sunday, 24 August 2008

Sysadmin: SORT command

Handy command line utility to sort plaintext file content and output in alphanumeric order.

The "/+1" defines at which character from the beginning of a new line should the utility start ordering from.

/t is the temporary storage location used to processed the data, useful if the data exceeds available memory

/c is the output file location

sort /+1 source.txt /t c:\temp\tempstorage.txt /o c:\temp\sorted.txt

Thursday, 21 August 2008

Sysadmin: Windows XP/2000 Command List

Here's the ultimate Windows XP/2000 command list that will make any Linux user feel at home at the command prompt. A lot of these commands are intended for administrating a network, but they are great for savvy home users as well. We even listed which OS you need for these commands.

  • at (windows XP/2000)
    Scheduling utility.

  • bootcfg (XP only) This utility allows you to set up your boot options, such as your default OS and other loading options.

  • cacls (XP, 2000, & NT4.0) Changes the ACLs (security Settings) of files and folders. Very similar to chmod in Linux.

  • comp (XP & 2000) This utility is very similar to diff in Linux. Use the /? switch to get examples of command usage.

  • contig (works with NT4.0 and newer) A great defrag utility for NTFS partitions.

  • control (XP only) - unpublished!
    Allows you to launch control panel applets from the command line.

  • control userpasswords2, for example will launch a helpful local user admin utility.
  • defrag (XP only - NT4.0 and Win2k use contig) Yes, XP comes with a command line disk defrag utility. If you are running Win2k or NT4.0 there is still hope. Contig is a free defrag program that I describe on the defrag page.

  • diskpart (XP only) Use this command to manage your disk partitions. This is the text version for the GUI Disk Manager.

  • driverquery (XP only) Produces a list of drivers, their properties, and their versions. Great for computer documentation.

  • eudcedit (XP only) -

  • unpublished!
    Private Character editor. Yes with this program built into Windows XP you can create your own font!
  • findstr
    Find String - similar to Linux's Grep.

  • fsutil (XP only) - unpublished!
    This is a utility with a lot of capability. Come back soon for great examples.

  • getmac (XP & 2000) This command gets the Media Access Control (MAC) address of your network cards.

  • gpresult (XP & 2000) This generates a summary of the user settings and computer group policy settings.

  • gpupdate (XP only) Use this utility to manually apply computer and user policy from your windows 2000 (or newer) domain.

  • ipconfig (XP, 2000 & NT4.0) This handy tool displays IP settings of the current computer and much more.

  • MMC (XP, 2000 & NT4.0) - Microsoft Management Console This is the master tool for Windows, it is the main interface in which all other tools use starting primarily in Windows 2000 and newer systems.

  • more Utility used to display text output one screen at a time. Ex. more c:\windows\win.ini

  • msconfig (XP only) The ultimate tool to change the services and utilities that start when your Windows machine boots up. You can also copy the executable from XP and use it in Win2k.

  • msinfo32 (XP &smp; 2000) An awesome diagnostic tool. With it you can get a list of running processes, including the residing path of the executable (great for manually removing malware) and get detailed information about hardware and system diagnostics.

  • narrator (XP only) Turns on the system narrator (can also be found in accessibility options in control panel). Will will allow your computer to dictate text to you.

  • netsh (XP & 2000) A network configuration tool console. At the 'netsh>' prompt, use the '?' to list the available commands and type "exit" to get back to a command prompt.

  • netstat (XP) A local network port tool - try netstat -ano.

  • nslookup (all) A DNS name resolution tool.

  • openfiles (XP Only)
    Allows an administrator to display or disconnect open files in XP professional. Type "openfiles /?" for a list of possible parameters.

  • Pathping (XP & 2000) A cross between the ping and traceroute utilities. Who needs Neotrace when you can use this? Type "pathping " and watch it go.

  • recover (XP & 2000) This command can recover readable information from a damaged disk and is very easy to use.

  • reg (XP & 2000) A console registry tool, great for scripting Registry edits.

  • sc (XP & 2000) A command line utility called the Service Controller. A power tool to make service changes via a logon/logoff or startup/shutdown script.

  • schtasks (XP only) A newer version of the AT command. This allows an administrator to schedule and manage scheduled tasks on a local and remote machines.

  • secedit (XP & 2000) Use this utility to manually apply computer and user policy from your windows 2000 (or newer) domain. Example to update the machine policy: secedit /refreshpolicy machine_policy /enforce To view help on this, just type secedit. NOTE: In Windows XP SP1 and news, this command is superceded by: gpupdate /force

  • sfc (XP & 2000) The system file checker scans important system files and replaces the ones you (or your applications) hacked beyond repair with the real, official Microsoft versions.

  • shutdown (XP & 2000) With this tool, You can shut down or restart your own computer, or an administrator can shut down or restart a remote computer.

  • sigverif (XP only) Microsoft has created driver signatures. A signed driver is Microsoft tested and approved. With the sigverif tool you can have all driver files analyzed to verify that they are digitally signed. Just type 'sigverif' at the command prompt.

  • systeminfo (XP only) Basic system configuration information, such as the system type, the processor type, time zone, virtual memory settings, system uptime, and much more. This program is great for creating an inventory of computers on your network.

  • sysedit (XP/2000) System Configuration File Editor. An old tool that was very handy for the Windows 9X days. msconfig is what you want to use now.

  • tasklist (XP pro only) Tasklist is the command console equivalent to the task manager in windows. It is a must have when fighting scumware and viruses. Try the command: tasklist /svc to view the memory resources your services take up.

  • taskkill (XP only) Taskkill contains the rest of the task manager functionality. It allows you to kill those unneeded or locked up applications.

  • tree (XP & 2000) An amazing experience everyone should try! This command will provide a 'family tree' style display of the drive/folder you specify.

  • WMIC (XP & 2000) Windows Management Instrumentation Command tool. This allows you to pull an amazing amount of low-level system information from a command line scripting interface.


Of course this list in note exhaustive. We wanted to focus on tools that are particularly helpful that everyone would use. For the official list, please visit: Microsoft Windows XP Pro Command Reference

Tuesday, 19 August 2008

Sysadmin: CCMexec.exe kills my pc

Since moving to a different floor at work, my PC has been going berserk. At around 10:30AM everyday the disk would thrash and run out of control. At first I thought it was the corporate virus scanner throwing a hissy-fit but downloading filemon.exe from sysinternal shows that my pc has been overtaken by this rather annoying executable - CCMEXEC.EXE.

A quick google around later, I found out that this file is used by Microsofts SMS service. Apparently used by the SMS host to deploy software and patches to desktop pc's across the corporate network. Basically another big brother tool from M$.

Killing this executable cured my PC from its spastic habits but I'll need to investigate more as to why it only runs on my PC and only at 10:30AM each day!! It is basically sucking the life force out of my HD causing it to wear and will probably make it sucidal in the end.

Friday, 30 May 2008

SysAdmin: Sysinternals, a bunch of cool tools

http://live.sysinternals.com/

First, you can point your browser to http://live.sysinternals.com/ for no-nonsense access to any Sysinternals tool. Even better, though, you can open up Windows Explorer and point it to \\live.sysinternals.com\ to browse and launch any Sysinternals app as though you've already downloaded and installed it on your computer. That means next time you're doing tech support for friends and you forgot your PC Rescue Kit, you can quickly get to any Sysinternals tool for help. At the very least, though, it's a quicker way to start the BlueScreen screen saver on a friends computer.