Kaseya Agent Procedure – FTP Remote Client Backup Script

Backup Windows Systems to a FTP Server

Download: -> Kaseya FTP Backups

So you have Kaseya clients out on the wire that need some level of backup but are not near a NAS or USB Drive. Have thoes clients backup to a FTP server by using WinSCP and a Kaseya Script to do the job for you.

This script has several peices and can be customized for what ever need you have. I currently have the script setup in 3 files.

File #1 (WinSCP_Backup.bat) This is executed by the Kaseya script and passed 2 variables. The variables are the name of the local folder and the name of the remote folder you want to sync.

Example:

c\temp\WinSCP_backup.bat userA FTPdirA >> c\temp\backup.log

We call the BAT file passing “userA” and “FTPDira” this could be the users name for their home directory and the remote directory which could be any folder on your ftp minus the first “/”

File #2 (WinSCP_backup.txt) This file tells WinSCP how to connect to your FTP server and what root directories to start looking in for the folder names provided above. You need to edit this file adding your FTP server information, username and password for FTP if needed.

File #3 is WinSCP.exe, This is a freely available FTP and SCP client for windows that is very configurable and has CLI functions.

This set of scripts in it’s current form will allow you to sync the local systems users home directories to a remote FTP server.

Sync is currently one direction as shown below. But you can sync any way you want.
c:\Documents and Settings\username  -> ftp://ftp.domainname.com/foldername

 Enjoy

Cubert  😎

Scripts to be used at your own descression, no warranty is implied.

How-to Setup Windows 2008 R2 Server Core As An Active Directory Server

Setup Active Directory on a Windows Server 2008 core

 

This is pretty simple actually; Install Windows as normal but selecting a Server Core as your installation medium. It will install just like a normal Windows 2008 install until the reboot process when it loads Windows for the first time. At the point it will ask for you to set your admin password and then boot to a Window’ish

Setup Active Directory on a Windows Server 2008 core

 

This is pretty simple actually; Install Windows as normal but selecting a Server Core as your installation medium. It will install just like a normal Windows 2008 install until the reboot process when it loads Windows for the first time. At the point it will ask for you to set your admin password and then boot to a Window’ish desktop where only a Command shell is available.

At first log in there are several things we need to do to prepare the system.

 

We need to assign the server a hostname

netdom renamecomputer %computername% /newname:YourServerName

Then we add our network information

netsh interface ipv4 set address name="Local Area Connection" source=static address=192.168.1.10 mask=255.255.255.0 gateway=192.168.1.1

Then we add our DNS servers

This should be the DNS address of your Active Directory DNS Server so replace 4.2.2.2 with that IP address.
netsh interface ipv4 set dns name="Local Area Connection" source=static address=4.2.2.2 primary

Confirm your new IP setup information

ipconfig /all

Now lets restart the system

shutdown -r -t 0

After we log back in from our reboot we join the existing domain

netdom join %computername% /domain:YourDomainName.

You notice I have a “.” at the end of the line! the denotes the end of the domain name and should be used.

Lets restart the server and bring it up as a member of the domain

shutdown -r -t 0

We should go ahead and activate Windows 2008 R2 now.

 cscript C:\windows\system32\slmgr.vbs -ato

Now we need to add the DNS-Server-Core-Role

ocsetup DNS-Server-Core-Role
 

To check if it was really installed we can run.

oclist |more

Now we dcpromo the server in the unattended mode

dcpromo /unattend /replicaOrNewDomain:replica /replicaDomainDNSNAME:YourDomainName  /ConfirmGC:Yes /UserName:YourDomainName\Administrator /Password:* /safeModeAdminPassword:YourPasswordHere

The (/Password:*) tells the Server to ask you it during the request to add after you run the command. The (/safeModeAdminPassword) sets what you want the local admin password to be if you need to log in “off” the domain.

The AD DS role will be installed and afterwords the server will reboot as a domain controller.

 

Now to make your job easier lets turn on Remote Desktop so you can RDP to the Windows 2008 Server Core and operate the command shell from remote.

cscript c:\windows\system32\scregedit.wsf /AR 0

I hope this helps someone out there get a Windows 2008 Server Core up and running as a Active Directory Server quickly.

Cubert

😎

How-to Emulate the TOP command in Windows

Top is a Linux process that shows a list of processes running on the system and what levels of resources are being used. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.

Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but don’t despair.   You can

Top is a Linux process that shows a list of processes running on the system and what levels of resources are being used. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.

Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but don’t despair.   You can use Power Shell to script a simple TOP style display that operates just like TOP on a Linux system.

 

Here is the one liner you need to get a top style process viewer running on windows.

while (1) { ps | sort -desc cpu | select -first 30; sleep -seconds 2; cls }

 

Copy the above line and paste it in to your Power Shell console. You should see something similar to the following image.

Kaseya 2 Agent procedures and free scripts

 

www.kaseya.com

 

Do you run Kaseya RMM and need some free scripts?

Here is a compilation of scripts I have created for Kaseya to do different tasks, feel free to use them but keep in mind there is no guarantee. Use at your own discretion!

# Blackberry Enterprise Server ( BES

 

www.kaseya.com


 

Do you run Kaseya RMM and need some free scripts?

Here is a compilation of scripts I have created for Kaseya to do different tasks, feel free to use them but keep in mind there is no guarantee. Use at your own discretion!

# Blackberry Enterprise Server ( BES ) server services restart script.

This script uploads a bat file “Blackberry_Restart.bat” that stops and restarts the Blackberry Enterprise server services in the correct order they need to be done. It the writes a event log entry to the local application event log on windows and then to the script log in Kaseya. Lastly it sends a email to help desk to let them know it ran. Download the zip file, unzip and import the XML file into Kaseya then upload the bat file to your public side Kaseya.

BlackberryES_Restart

# Retrieve IE History

Use this script to collect a logged in users IE history. When the boss wants to know what a users been surfing you can run this against the system and have it email all the links the user has gone to.

This script uploads and executes a VB scrpt (iehistory2.vbs) on the remote system that uses NirSoft’s IE History View utility (iehv.exe) to dump IE URL history addresses for all user profiles on the system into a text file (history.txt). The contents of the text file are then captured into a Kaseya variable and emailed to an address or addresses specified in STEP 7.  Download the zip file, unzip and import xml file in to scripts on Kaseay server then upload the vb script and iehv.exe to Kaseya public file store. Edit the Kaseya script at line item 7 and place in your email address.

IEHistory

# VMware VCenter Health Check

The script grabs the basic state of things on your VMware ESX VCenter VSphere server and posts an HTML file to the “get file” area in Kaseya KLC. It uses a PowerTools Shell to collect the data and create the file. Download the zip, unzip and import the XML file it scripts. Upload the ps1 file to Kaseya Public folder and then edit script and locate the file in script and save script. This will update the script with the location of where you saved the ps1 file.

VMWare VCenter Health Check

#Windows Systems CCleaner Script

This script is a great tool for cleaning of temp files and caches from a users profile on any Windows system. The script looks at the system and determines if it is 64 bit or 32 bit, then it downloads the correct ccleaner.exe file and runs it against the system. In auto mode this script does not clean the registry so it is safe to schedule and run on a regular bases. This works on all 32 and 64 it windows including Windows 2008 R2. A user must be logged in for script to run on users profile.

Kaseya-CCLeaner-Script

Look for more of my scripts here on Squidworks.net

Enjoy

Cubert

How to configure Windows TCP/IP settings from the Command Prompt (CLI)

Window’s Netsh.exe command-line scripting utility  allows you to display or modify the network configurations of any computer that is currently running a resent flavor of Windows. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a computer both locally and remotely.  You can also use Netsh.exe to save a configuration script in a text file for archival purposes or to help you configure

Window’s Netsh.exe command-line scripting utility  allows you to display or modify the network configurations of any computer that is currently running a resent flavor of Windows. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a computer both locally and remotely.  You can also use Netsh.exe to save a configuration script in a text file for archival purposes or to help you configure network information when changing networks.

Here are your commands and what they can do.

View your TCP/IP settings.

netsh interface ip show config

 

Configure your computer’s IP address and other TCP/IP related settings.

This command configures the interface named Local Area Connection with the static IP address 192.168.0.101, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:

netsh interface ip set address name="Local Area Connection" static 192.168.0.101 255.255.255.0 192.168.0.1 1

Configure your NIC to automatically obtain an IP address from a DHCP server

netsh interface ip set address "Local Area Connection" dhcp

To configure DNS and WINS addresses from the Command Prompt

netsh interface ip set dns "Local Area Connection" static 192.168.0.101
netsh interface ip set wins "Local Area Connection" static 192.168.0.101

To configure your NIC to dynamically obtain it’s DNS settings

netsh interface ip set dns "Local Area Connection" dhcp

Now let’s say you have a laptop and it travels between 2 separate networks and you need to maintain separate static configurations for each network. There is a simple way to flip back and forth between networks by creating a simple batch file. Here is how it’s done.

First we export your current IP settings to a text file:

netsh -c interface dump > c:\network1.txt

Next we change the settings manually on the interface to the second network and then export it as well:

netsh -c interface dump > c:\network2.txt

Now we have 2 text files, each file represents a network location. Whenever you need to quickly change your IP settings to switch between networks you can run the following commands

netsh -f c:\network1.txt
or
netsh -f c:\network2.txt

Now to make a batch file to execute the command just create a file called network1.bat and network2.bat and add the perspective line to that file. You can also use the global EXEC switch instead of  “-f ”  switch in the batch file with the same results.

Here are all the options available to netsh.exe

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password| *]
    

Commands available:

?              – Displays a list of commands.
add            – Adds a configuration entry to a list of entries.
advfirewall    – Changes to the `netsh advfirewall’ context.
branchcache    – Changes to the `netsh branchcache’ context.
bridge         – Changes to the `netsh bridge’ context.
delete         – Deletes a configuration entry from a list of entries.
dhcp           – Changes to the `netsh dhcp’ context.
dhcpclient     – Changes to the `netsh dhcpclient’ context.
dnsclient      – Changes to the `netsh dnsclient’ context.
dump           – Displays a configuration script.
exec           – Runs a script file.
firewall       – Changes to the `netsh firewall’ context.
help           – Displays a list of commands.
http           – Changes to the `netsh http’ context.
interface      – Changes to the `netsh interface’ context.
ipsec          – Changes to the `netsh ipsec’ context.
lan            – Changes to the `netsh lan’ context.
mbn            – Changes to the `netsh mbn’ context.
namespace      – Changes to the `netsh namespace’ context.
nap            – Changes to the `netsh nap’ context.
netio          – Changes to the `netsh netio’ context.
p2p            – Changes to the `netsh p2p’ context.
ras            – Changes to the `netsh ras’ context.
rpc            – Changes to the `netsh rpc’ context.
set            – Updates configuration settings.
show           – Displays information.
trace          – Changes to the `netsh trace’ context.
wcn            – Changes to the `netsh wcn’ context.
wfp            – Changes to the `netsh wfp’ context.
winhttp        – Changes to the `netsh winhttp’ context.
winsock        – Changes to the `netsh winsock’ context.
wlan           – Changes to the `netsh wlan’ context.

 

Enjoy

Cubert

Windows 7 – Add a non-indexed UNC path as a library

Add a non-indexed UNC as a library in Windows 7

There is an occasion when you may want to add a non indexed UNC path to a library inside of your Windows 7 system. Normally Windows bitches and complains when you try to hook up a UNC path that is not indexed but by tricking it we can make it happen. Here is how you do it.
===========================
1. Create a

Add a non-indexed UNC as a library in Windows 7

There is an occasion when you may want to add a non indexed UNC path to a library inside of your Windows 7 system. Normally Windows bitches and complains when you try to hook up a UNC path that is not indexed but by tricking it we can make it happen. Here is how you do it.

===========================
1. Create a folder on your hard drive for shares. i.e. c:\share
2. Create another folder in the above share. i.e. c:\share\music
2. Link the Library to this folder.
3. Now delete the music folder but leave the c:\share folder.
4. Use the mklink in an elevated command prompt to make a symbolic link. Name the link the same as the folder you created above. 
mklink /d c:\share\music \\server\music
5. Your done. Now you have non-indexed UNC path as a library in Windows 7.

 

This process works much better than the other option which is to make “Available Offline”. If your like me and have a very large storage server running a OS like Linux or BSD to house all your media then making it available offline is no good. It would require a copy of the entire share be placed on your local drive and that could cost you every piece of free space on my Windows 7 system and then some.


I hope this helps someone out there with large media shares get their library setup.

Enjoy

Cubert

\NETLOGON fnum 0x8007 returned critical error. Error was NT_STATUS_PIPE_DISCONNECTED

Samba and Winbind Fix for Windows 2008 R2 Active Directory Services

Having issues with file sharing when inside a Windows 2008 R2 Domain? Are you getting these errors in you logs?
rpc_client/cli_pipe.c:rpc_api_pipe(790)
rpc_api_pipe: Remote machine 0.0.0.0 pipe \NETLOGON fnum 0x8007 returned critical error. Error was NT_STATUS_PIPE_DISCONNECTED
A little searching online shows a lot of people with this or related problems, It looks like there’s a bug in the samba package that prevents

Samba and Winbind Fix for Windows 2008 R2 Active Directory Services

Having issues with file sharing when inside a Windows 2008 R2 Domain? Are you getting these errors in you logs?

rpc_client/cli_pipe.c:rpc_api_pipe(790)
rpc_api_pipe: Remote machine 0.0.0.0 pipe \NETLOGON fnum 0x8007 returned critical error. Error was NT_STATUS_PIPE_DISCONNECTED

A little searching online shows a lot of people with this or related problems, It looks like there’s a bug in the samba package that prevents it from working with Windows Server 2008 R2 domains. If you’re running into this problem, the solution is to remove your existing samba installation and install, instead, the samba3x packages.

Run the following on your Redhat or CentOS installation.

yum erase samba samba-common
yum install samba3x samba3x-client

You will need to rebuild your connections to AD via winbind and rebuild your SMB.conf so I would suggest you save your files before starting the process.

If you need help rebuilding Winbind and Samba this web post is a great example how to do it.

http://www.sweetnam.eu/index.php/Using_Active_Directory_for_CentOS

Enjoy.

P.s

When joining server to AD (step #9) in web post

 net ads join -U administrator@SWEETNAM.EU

It seems to join correctly if you just use “admin username” with out the @domain added to the line. It always seems to fail if I use the entire domain name in the join request. Instead I use the following example and it works great for me.

net ads join -U administrator

Good Luck

Cubert

XYMON External Test Script for APC NetBotz Environment Monitor

So you got a APC environment monitor (NetBotz) and you want XYMON / Hobbit / BB to monitor and alert if your tempature is rising? Funny me too.

I spent several hours trying to get a VB script to built to do this and I am just not a big fan of VB. So being a Perl plucker I desided to write one in Perl and share it with

So you got a APC environment monitor (NetBotz) and you want XYMON / Hobbit / BB to monitor and alert if your tempature is rising? Funny me too.

I spent several hours trying to get a VB script to built to do this and I am just not a big fan of VB. So being a Perl plucker I desided to write one in Perl and share it with everyone.   

Here is what it does:

The script  queries via SNMP the OID for the tempature sensors current state and then create a XYMON file and place it in the tmp folder where XYmon(BBWin) resides  so that the XYMON(BBWin) service can pick it up and transmit the information to the BBDisplay.

Prereqs are: Windows host, BBWin, ActiveState Perl 5 installed on windows, snmpget.exe application located at http://www.snmpsoft.com/freetools/snmpget.html
Place SNMPGET.EXE in an area that is seen by Windows PATH.

Add to BBWin.cfg under the <Externals> area of XML:

<load value=”C:\Perl\bin\perl.exe netbotz.pl” timer=”5m” />

and copy this script to the BBWin/Bin directory. Every 5 minutes you should see a “NetBotz” file created in BBWin/tmp and shortly afterwards BBwin will remove file once data is sent. On your BBDisplay you should get a new column called [NetBotz] and when you select the “Dot” it will display the current temp.

You may need to play with the OID # for your install of Netbotz as mine had 8 ports (OID’s) for tempature monitors but we only used 1 port so I am only monitoring that OID.

OID’s are

1.3.6.1.4.1.318.1.1.10.4.2.3.1.5.0.1

through

1.3.6.1.4.1.318.1.1.10.4.2.3.1.5.0.14

So adjust the last digits (1-14) for your sensor location on Netbotz.

Download -> Netbotz Perl script

Enjoy Shannon, aka Cubert

Exchange 2007-> Adding and/or Deleting Holidays to and from All User Calendars

You can  customize the Outlook holiday file to include your own holiday information. You might choose to do this if a particular local holiday is not included in the Outlook file and you want to deploy new holiday information to a large group of people (if you just want to do this for yourself, it’s probably easier to just add events directly to your calendar).

You can open the

You can  customize the Outlook holiday file to include your own holiday information. You might choose to do this if a particular local holiday is not included in the Outlook file and you want to deploy new holiday information to a large group of people (if you just want to do this for yourself, it’s probably easier to just add events directly to your calendar).

You can open the holiday file, usually located in C:\Program Files\Microsoft Office\Office<Ver>\<LCID>\Outlook.hol, to edit which holidays are added to your calendar when you import holidays. For example, if you are using a US English version of Outlook 2007, you would usually find your holiday file at C:\Program files\Microsoft Office\Office12\1033\Outlook.hol. If you don’t know the LCID of your language, look for a folder under the Office12 folder that only has a numerical name, that’s probably the right one.

Note: You need to be a local administrator on the computer to edit the holiday file.

After you have the file open, you’ll find a listing of holidays for several different locations. Each location’s holidays start with a header, that includes the location name inside square brackets, and the number of holidays listed for that location. For example, for the United States you might see a header like this:

[United States] 168

If you add additional holidays to the file, make sure to increment the number or some holidays will be missed.

Each line inside a section represents a specific instance of a holiday. For example, the section for holidays in the United States contains a line like this:

Groundhog Day,2008/2/2

This line includes the holiday name (Groundhog Day), then a comma, and then the date the holiday occurs in the format year/month/day. To add your own holidays to the calendar, just add new lines to the bottom of the file in the same format, save the file, and then import your location’s holidays.

If you decide to edit the holiday file to add your own holidays, consider adding them as a brand new location instead of adding them to an existing location. This way you can choose to import only the new holidays without creating duplicates of the existing holidays you have previously added. For example, if you wanted to create a listing of all your associates birthdays, you could add a listing like this to the end of the file:

[Birthdays] 3
Ryan’s Birthday,2008/1/1
Ryan’s Birthday,2009/1/1
Ryan’s Birthday,2010/1/1

After you have finished editing the holidays file, remember to keep a back up. Because the file is installed with Outlook, it can be modified or replaced with the original if you install an update or upgrade to a newer version.

Outlook Command line switches:

Switch Description Works in
/a path:\<filename> Creates an item with the specified file as an attachment. Example:
"C:\Program Files\Microsoft Office\Office12\Outlook.exe" /a "C:\My Documents\labels.doc"
If no item type is specified, IPM.Note is assumed. Cannot be used with message classes that aren’t based on Outlook.
2000, 2002/XP, 2003, 2007, 2010
/altvba <otmfilename> Opens the VBA program specified in otmfilename, rather than %appdata%\Microsoft\Outlook\VbaProject.OTM. 2003, 2007, 2010
/autorun macroname Opens Outlook and immediately runs the macro specified in macroname.
(no longer supported after Outlook 2003 SP2)
2003
/c <messageclass>
Creates a new item of the specified message class (Outlook forms or any other valid MAPI form).Examples:
  • /c ipm.activity creates a Journal entry
  • /c ipm.appointment creates an appointment
  • /c ipm.contact creates a contact
  • /c ipm.note creates an e-mail message
  • /c ipm.stickynote creates a note
  • /c ipm.task creates a task
2002/XP, 2003, 2007, 2010
/checkclient Prompts for the default manager of e-mail, news, and contacts. 2000, 2002/XP, 2003, 2007, 2010
/cleanautocompletecache Removes all names and e-mail addresses from the AutoComplete list. 2010
/cleancategories Deletes any custom category names that you have created. Restores categories to the default names. 2007, 2010
/cleanclientrules Starts Outlook and deletes client-based rules. 2003, 2007, 2010
/cleanconvongoingactions Deletes the Conversations Actions Table (CAT). CAT entries for a conversation thread usually expire 30 days after no activity. The command-line switch clears all conversation tagging, ignore, and moving rules immediately stopping any additional actions. 2010
/cleandmrecords Deletes the logging records saved when a manager or a delegate declines a meeting. 2003, 2007, 2010
/cleanfinders Removes Search Folders from the Microsoft Exchange server store. 2000, 2002/XP, 2003, 2007, 2010
/cleanfreebusy Clears and regenerates free/busy information. This switch can only be used when you are able to connect to your Microsoft Exchange server. 2000, 2002/XP, 2003, 2007, 2010
/cleanfromaddress Removes all manually added From entries from the profile. 2010
/cleanips Restores receival of new messages in Exchange Cached mode (KB968773) 2007, 2010
/cleanprofile Removes invalid profile keys and recreates default registry keys where applicable. 2003, 2007
/cleanpst Launches Outlook with a clean Personal Folders file (.pst) 2003
/cleanreminders Clears and regenerates reminders. 2000, 2002/XP, 2003, 2007, 2010
/cleanroamedprefs All previous roamed preferences are deleted and copied again from the local settings on the computer where this switch is used. This includes the roaming settings for reminders, free/busy grid, working hours, calendar publishing, and RSS rules. 2007, 2010
/cleanrules Starts Outlook and deletes client- and server-based rules. 2003, 2007, 2010
/cleanschedplus Deletes all Schedule+ data (free/busy, permissions, and .cal file) from the server and enables the free/busy information from the Outlook Calendar to be used and viewed by all Schedule+ 1.0 users. 2000, 2002/XP, 2003
/cleanserverrules Starts Outlook and deletes server-based rules. 2003, 2007, 2010
/cleansharing Removes all RSS, Internet Calendar, and SharePoint subscriptions from Account Settings, but leaves all the previously downloaded content on your computer. This is useful if you cannot delete one of these subscriptions within Outlook 2010. 2010
/cleansniff Deletes duplicate reminder messages. 2003, 2007, 2010
/cleansubscriptions Deletes the subscription messages and properties for subscription features. 2003, 2007, 2010
/cleanviews Restores default views. All custom views you created are lost. 2000, 2002/XP, 2003, 2007, 2010
/designer Starts Outlook without figuring out if Outlook should be the default client in the first run. 2003
/embedding <msgfilename> Opens the specified message file (.msg) as an OLE embedding. Also used without command-line parameters for standard OLE co-create. 2002/XP, 2003, 2007, 2010
/explorer Opens the new window in “explorer” mode (link bar on). 2000, 2002/XP, 2003, 2007, 2010
/f <msgfilename> Opens the specified message file (.msg) or Microsoft Office saved search (.oss).
(Support for oss-files has been dropped since Outlook 2003 SP2 due to security restrictions)
2002/XP, 2003, 2007, 2010
/finder Opens the Advanced Find dialog box. 2007, 2010
/firstrun Starts Outlook as if it were run for the first time. 2003, 2007
/folder Opens a new window in “folder” mode (Navigation Pane off). 2000, 2002/XP, 2003, 2007, 2010
/hol <holfilename.hol> Opens the specified .hol file. 2003, 2007, 2010
/ical <icsfilename> Opens the specified .ics file. 2003, 2007, 2010
/importprf path:\<filename.prf> Launches Outlook and opens/imports the defined MAPI profile (*.prf). If Outlook is already open, queues the profile to be imported on the next clean launch. 2002/XP, 2003, 2007, 2010
/l <olkfilename> Opens the specified .olk file. 2003
/launchtraininghelp assetid Opens a Help window with the Help topic specified in assetid. 2003, 2007, 2010
/m emailname Provides a way for the user to add an e-mail name to the item. Only works in conjunction with the /c command-line parameter.
Example:
Outlook.exe /c ipm.note /m emailname
2003, 2007, 2010
/nocustomize Starts Outlook without loading outcmd.dat (customized toolbars) and *.fav file. 2003, 2007
/noextensions Starts Outlook with extensions turned off, but listed in the Add-In Manager. 2003, 2007
/nopollmail Starts Outlook without checking mail at startup. 2003
/nopreview Starts Outlook with the Reading Pane off and removes the option from the View menu. 2000, 2002/XP, 2003, 2007, 2010
/p <msgfilename> Prints the specified message (.msg).
Prior to Outlook 2007, this does not work with HTML messages.
2002/XP, 2003, 2007, 2010
/profile <profilename> Loads the specified profile. If your profile name contains a space, enclose the profile name in quotation marks (“). 2002/XP, 2003, 2007, 2010
/profiles Opens the Choose Profile dialog box regardless of the Options setting on the Tools menu. 2002/XP, 2003, 2007, 2010
/recycle Starts Outlook using an existing Outlook window, if one exists. Used in combination with /explorer or /folder. 2000, 2002/XP, 2003, 2007, 2010
/regserver Rewrites all Outlook specific registry keys and re-associates file extensions without having to reinstall Outlook or run setup with the /y switch. The settings are stored in the Outlook.srg file located in the same folder as the Outlook program. 2000, 2002/XP
/remigratecategories Starts Outlook and and initiates the following commands on the default mailbox:

  • Upgrades colored For Follow Up flags to Office Outlook 2007 color categories.
  • Upgrades calendar labels to Office Outlook 2007 color categories.
  • Adds all categories used on non-mail items into the Master Category List.

Note: This is the same command as Upgrade to Color Categories in each Outlook mailbox properties dialog box.

2007, 2010
/remigrateconversations 2010
/resetfoldernames Resets default folder names (such as Inbox or Sent Items) to default names in the current Office user interface language.For example, if you first connect to your mailbox Outlook using a Russian user interface, the Russian default folder names cannot be renamed. To change the default folder names to another language such as Japanese or English, you can use this switch to reset the default folder names after changing the user interface language or installing a different language version of Outlook. 2002/XP, 2003, 2007, 2010
/resetfolders Restores missing folders for the default delivery location. 2000, 2002/XP, 2003, 2007, 2010
/resetformregions Empties the form regions cache and reloads the form region definitions from the Windows registry. 2007, 2010
/resetoutlookbar Rebuilds the Outlook Bar. 2000, 2002/XP
/resetnavpane Clears and regenerates the Navigation Pane for the current profile. 2003, 2007, 2010
/resetquicksteps Restores the default Quick Steps. All user-created Quick Steps are deleted. 2010
/resetsearchcriteria Resets all Instant Search criteria so that the default set of criteria is shown in each module. 2007, 2010
/resetsharedfolders Removes all shared folders from the Navigation Pane. 2007, 2010
/resettodobar Clears and regenerates the To-Do Bar task list for the current profile. The To-Do Bar search folder is deleted and re-created. 2007, 2010
/restore Attempts to open the same profile and folders that were open prior to an abnormal Outlook shutdown. 2010
/rpcdiag Opens Outlook and displays the remote procedure call (RPC) connection status dialog. 2003, 2007, 2010
/s <filename> Loads the specified shortcuts file (.fav). 2002/XP, 2003
/safe Starts Outlook without extensions, Reading Pane, or toolbar customization. 2000, 2002/XP, 2003, 2007, 2010
/safe:1 Starts Outlook with the Reading Pane off. 2003, 2007, 2010
/safe:2 Starts Outlook without checking mail at startup. 2003
/safe:3 Starts Outlook with extensions turned off, but listed in the Add-In Manager. 2003, 2007, 2010
/safe:4 Starts Outlook without loading Outcmd.dat (customized toolbars) and *.fav file. 2003, 2007
/select foldername Starts Outlook and opens the specified folder in a new window. For example, to open Outlook and display the default calendar use:
"C:\Program Files\Microsoft Office\Office12\Outlook.exe" /select outlook:calendar
2002/XP, 2003, 2007, 2010
/share feed://URL/filename
/share stssync://URL
/
share web://URL/filename
Specifies a sharing URL to connect to Outlook. For example, use stssync://URL to connect a Microsoft Windows SharePoint Services 3.0 list to Outlook. 2007, 2010
/sniff Starts Outlook and forces a detection of new meeting requests in the Inbox, and then adds them to the calendar. 2003, 2007, 2010
/t <oftfilename> Opens the specified .oft file. 2003, 2007, 2010
/unregserver Deletes all registry keys and file associations for Outlook. Its actions are based on the Outlook.srg file located in the same folder as the Outlook application. Use the /regserver switch to rewrite the registry keys and file associations after using this switch. 2000, 2002/XP
/v <vcffilename> Opens the specified .vcf file. 2003, 2007, 2010
/vcal <vcsfilename> Opens the specified .vcs file. 2003, 2007, 2010
/x <xnkfilename> Opens the specified .xnk file. 2003, 2007

“Terminal Server Has Exceeded the Maximum Number of Allowed Connections” fix via Command line (CLI)

The terminal server has exceeded the maximum number of allowed connections. The system can not log you on. The system has reached its licensed logon limit. Please try again later.”

This problem happens because Windows only allows two remote terminal services connections when you are in administrative mode, and you’ve either got two people already on that server, or more likely, you’ve got a disconnected session that still thinks it

The terminal server has exceeded the maximum number of allowed connections. The system can not log you on. The system has reached its licensed logon limit. Please try again later.”

This problem happens because Windows only allows two remote terminal services connections when you are in administrative mode, and you’ve either got two people already on that server, or more likely, you’ve got a disconnected session that still thinks it is active.

The problem with this error is that you have to actually get on the server console to fix the problem if the server isn’t in a domain. (If you are in a domain, then just open Terminal Services Manager and log off or disconnect the sessions)

Here’s a command line arguments that you can use to figure out what sessions are connected to the server. Note that you could substitute the IP address for the server name.

query session /server:servername

Output:

Now we know that the session ID of the offending session is 2. We can use that in the next step, which is using the reset command to log off that user.

reset session [ID] /server:servername

This command won’t display any output, but when we run the query command again, we should see that the session has now been disconnected:

Output:

I hope this helps to get you back in to your terminal sessions!

Enjoy…