Pages

Monday, June 25, 2012

Test SMTP operations using TELNET

SMTP (Simple Mail Transfer Protocol) is the protocol that the Internet mail is sent. You can send directly from the command prompt an e-mail, using Telnet. Telnet into Exchange server hosting IMS service using TCP port 25. (C:\Windows \ telnet.exe)


  1. Click Start > Programs > Accessories > Command Prompt 
  2. Type "telnet  <servername.sub-domain.com 25>", and press Enter
  3. Type "HELO <servername.sub-domain.com>", and press Enter
  4. Type "MAIL FROM:<your Email Address>", and press Enter
  5. Type "RCPT TO:<Recipient Address>", and press Enter
  6. Type "Data", and press Enter
  7. Type "Subject:<Subject field of Email message>", press Enter twice
  8. Type "enter your body text here.>" don't forget the final (.) in the text. Press Enter
  9. Type ".", and then press Enter
  10. Finally type "QUIT", and then press Enter.


Saturday, June 16, 2012

Nagios 3 monitoring Windows Servers


Nagios is a Open Source Host. It is a  Network Monitoring Services. Nagios provides an extensible framework, that can monitor pretty much anything. With it you can use diferent plugins, you can monitor any Operating System in Linux, Windows, and Mac. In this post I explain how to monitor Windows Servers in any network.
I assume that at this point you have installed Nagios. If you haven't install Nagios go to:  http://systemadministratorrecipes.blogspot.com/2012/06/scripts-nagios-for-install-on-ubuntu.html

1. Windows Server preparation with NSClient++ 


  • Go to http://www.nsclient.org/nscp/downloads and get the .msi of the last version for win32 or x64
  • After download, on the archive double click for starting installation
    • On the first windows, click Next
    • In End-User License Agreement windows, "I accept the terms in the License Agreement" check mark, and then click Next
    • Select Custom Setup, then click Next
    • In Custom Setup windows, click Next
    • In NSCliente++ Configuration windows, click Next
    • In the new NSClient++ Configuration windows, in the first line type IP Address of the Nagios server
    • In the "Modules to load", click to check mark all modules, and then click Next
    • In the last windows, click Finish
  • Click Start > Administrative tools > Services
  • In NSClient++ service, right click Properties
  • Click on Log On tab, and then click to check mark "Allow service to interact with desktop", then click OK
  • Close Services window
  • Go to "C:\Program Files\NSClient++", and open nsc.ini in Notepad
  • In the modules section, remove semicolons from the modules as show below:
    • FileLogger.dll
    • checkSystem.dll
    • Checkdisk.dll
    • NSClientListener.dll
    • NRPEListener.dll
    • SysTray.dll
    • CheckEventLog.dll
    • CheckHelpers
    • CheckExternalScripts
    • NRPEClient.dll
  • In the settings section, these should be only two line without semicolons as show below:
    • use_file=1
    • allowed_host=10.44.5.223 "Remplace with your Nagios server's IP"
  • That should do it, save the file, and then click to close Notepad
  • Click Start > Administrative Tools > Services
  • In NSCliente++ services right click, and then click to Restart
  • Click to close Services window

2. Go to Nagios configuration host-group for Windows Servers


  • Press Alt+F2, type Terminal, and press Enter
  • In terminal type "gksudo nautilus" (if you don't  have installing Nautilus go to: http://systemadministratorrecipes.blogspot.com/2012/06/open-nautilus-as-root-in-ubuntu.html there you have all step for install it)
  • In the windows click Files system > usr > local > nagios > etc > nagios.cfg
  • Right click in nagios.cfg and select Open with Text Editor in my case "Kate"
  • Find this section:
    • #definitions for monitoring a Windows Machine
    • #cfg_file=/usr/local/nagios/ect/objects/windowss.cfg
  • And delete "#" from the start in the second line, click to Save and Close
  • Go to  /usr/local/nagios/etc/objects/windows.cfg
  • Right click in windows.cfg and select Open with a Text Editor in my case "Kate"
  • First, go to the "Host Definition", we define each host here
e.g

define host{
               use                      windows-server                        ; Inherit default values from template
               host_name           DC-Server.xxxxxxxx.com      ; The name we're giving to this host
               alias                     DC-Server                               ; A longer name associated with the server
               address                192.168.10.10                          ; IP address of the host
               hostgroups           windows-servers                     ; The group or groups we need this server .....
               }

You can add more host here, but remember add the last line "hostgroups        windows-servers"

  • Second, go to the "Host Group Definition", we define hostgroup here
e.g

define hostgroup{
                        hostgroup_name    windows-servers                    ; The name of the hostgroups
                        alias                       Windows Servers                   ;  Long name of the group
                          }

Make sure the hostgroup_name define here and the hostgroups define in each host define above are the same.

  • Finally, go to "Service  Definitions", we define services here
e.g

define service{
                    use                           generic-service
                    hostgroup_name       windows-servers
                    check_command      check_nt!SERVICESTATE!-d SHOWALL -l W#SVC
                     }

Here you change host_name for hostgroup_name. You need to do this for all define services.

  • Save and Quit
Remember, every time you change the Nagios configuration files, you mush check the files before using them:
  • Press Alt+F2, type Terminal, and then press Enter
  • In Terminal, type /etc/init.d/nagios restart
  • After restart, type /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If you receive Total warnings:0 and Total Errors:0. You are ready for starting Nagios.


Open Nautilus as Root in Ubuntu | Linux


Sometimes you need to edit files and save data change. Ubuntu / Linux has a tool that allows us to access folders and files as Administrator. It is Nautilus.

To install Nautilus follow these orders:
  1. Press Alt+F2, then type Terminal or Konsole
  2. In Terminal type sudo su, then press Enter
  3. Type you Administrator password, then press Enter
  4.  Type apt-get install gksu, then press Enter
  5.  Type apt-get install nautilus, then press Enter
  6.  Type nautilus -q, and then press Enter
Nautilus was installed. Now you can use it to make changes to your System as Administrator.

Now, to enter as a root:
  • Press Alt+F2, then type Terminal or Konsole
  • In Terminal type "gksudo nautilus", and then press Enter
Congratulation! Now you have all privileges on your System. 

Install Nagios 3 on Ubuntu Server 12.04 with a Script


Nagios is a popular Open Source Computer System and Network Monitoring software application. With this tool, you can monitor your entire IT infrastructure, spot problems before they occur, know immediately when problem arise, and more. Here are two new scripts that you can use for easy Nagios installation on Ubuntu Server 12.04.  

  1. Copy and Paste the script below into a Text Editor  e.g  Kate
  2. Save it in the Home folder as  archive_name.sh
  3. Open Terminal
  4. Type sudo su, then press Enter
  5. Type you password, then press Enter
  6. Type  chmod  +x  archive_name.sh, then press Enter
  7. Type ./archive_name.sh, then press Enter. The installation begins
  8. You should just enter the password for user of Nagios

Nagios Script:

If you end up in the terminal you see warning:0 and error:0. Congratulation! you'll be ready to start  your network monitor.
  • Open your browser, in the address bar type "localhost / nagios /", and then press Enter
  • Type Nagios username: nagiosadmin
  • Type Nagios username password: "this is what you defined when you entered some password in the script"

Tuesday, June 12, 2012

Error : "Your credentials are invalid." Citrix Web Interface


  • Click Start > Run 
  • Type mmc, and then click OK
  • Click File > Add/Remove snap-in...
  • In Standalone Tab, Click Add button
  • In Add Standalone snap-in, click to select Active Directory Users and Computers, click Add, and then click Close
  • In Add/Remove snap-in, click OK
  • Click to close Console1
  • In Microsoft Management Console dialog, click Yes to save settings
  • In address bar, select Administrative Tools folder, rename file in File name bar, and then click Save button

Sunday, June 10, 2012

Clean Up Server Metadata Windows Server 2008


1. Clean up server metadata by using Active Directory Users and Computers

  • Click Start > Administrative Tools > Active Directory Users and Computers
  • Right click Active Directory Users and Computers, then click Change Domain Controller
  • Click the name of the Domain Controller from which you want to remove the metadata, and then click OK
  • Expand the domain of the domain controller that was forcibly removed, then click Domain Controllers
  • In the right panel, right click the computer object whose metadata you want to clean up. Click Delete
  • In the Active Directory Domain Services dialog box, click Yes
  • In the Domain Controller dialog box, select "This Domain Controller is permanently offline and can no longer be demoted using the Active Directory Domain Services Installation Wizard (DCPROMO)", then click Delete
  • If the Domain Controller is a Global Catalog server, in the Delete Domain Controller dialog box, click Yes
  • If the Domain Controller currently holds one or more operations master roles, click OK to move the roles to the Domain Controller that is shown

2. Clean up server metadata by using Active Directory Sites and Services

  • Click Start > Administrative Tools > Active Directory Sites and Services
  • Expand Sites > Domain Controller that was forcibly remove > Servers
  • Right click NTDS Settings object, click Delete
  • In Active Directory Domain Services dialog box, click Yes
  • In the Deleting Domain Controller dialog box, select "This Domain Controller is permanently offline and can no longer be demoted using the Active Directory Domain Services Installation Wizard (DCPROMO)", click Delete
  • If the Domain Controller is a Global Catalog server, in the Delete Domain Controller dialog box, click Yes
  • If the Domain Controller currently holds one or more operations master roles, click OK to move the roles to the Domain Controller that is shown
  • Right click the Domain Controller that was forcibly remove, then click Delete
  • In Active Directory Domain Services dialog box, click Yes

3. Clean up server metadata by using Ntdsutil

  • Click Start, right click Command Prompt, click Run as administrator, and then click Yes
  • At the Command Prompt type "ntdsutil", then press Enter
  • At the ntdsutil: prompt, type "metadata cleanup", then press Enter
  • At the metadata cleanup: prompt, type "remove selected server <ServerName>" or  "remove selected server <ServerName1> on <ServerName2>", then press Enter
  • In Server Remove Configuration Dialog, review the information and warning, and then click Yes
  • At the metadata cleanup: and ntdsutil: prompt, type "quit", then press Enter



Saturday, June 9, 2012

Windows can't connect update... Error 80072efd on Small Business Server 2008


  • Click Start > Run > type "regedit"
  • Navigate to HKLM\Software\Policies\Microsoft\Windows\WindowsUpdates
  • Look at the keys in that folder, if they look something like this:
          "WUServer"="http://SERVER:8530"
          "WUStatusServer"="http://SERVER:8530"
  • Right click on "WindowsUpdate" key > click Export this to a .reg file to be safe
  • Delete the "WindowsUpdate" key from the registry at  HKLM\Software\Policies\Microsoft\Windows\WindowsUpdates
  • Close Registry Editor
  • Click Start > Run > type "services.msc
  • In the right panel, locate Windows Update services. Right click > Restart 
 After that, you can download and install new updates.

Migrating Active Directory Domain Controller from Server 2003 to Sever 2008

1. Raise Domain Functional Level (Server 2003)

  • Click Start > Administrative Tools > Active Directory User and Computers 
  • Right-Click the Domain Name node. Click on Rise Domain Functional Level 
Note: If you have Windows 2000 Active Directory Domain Controllers then choose Windows 2000     Native. If you don't have any Windows 2000 AD-DC, and all of you Domain Controllers are Windows Server 2003 then choose Windows Server 2003.
  • Click OK, in  a warning message
  • Click OK, in a confirmation message
  • Close Active Directory User and Computers

2. Prepare Forest Level and Domain Level (Server 2003)

  • Insert Windows Server 2008 DVD inside the Server 2003 DVD Drive
  • Run as Administrator Command Prompt
  • If the DVD is Windows Server 2008 32 bit. Type D:\sources\adprep\adprep /forestprep (Where D: is the drive of your Windows Server 2008 DVD)
  • If the DVD is Windows Server 2008 64 bit. Type D:\support\adprep\adprep /forestprep. Press Enter
  • Read a warning message, if you don't have any Windows 2000 Active Directory, type C and then press Enter
Note: After Forest preparation is completed successfully, run the Domain prep rotation command.
  • If the DVD is Windows Server 2008 32 bit Type D:\sources\adprep\adprep /domainprep (Where D: is the drive of your Windows Server 2008 DVD)  
  • If the DVD is Windows Server 2008 64 bit. Type D:\support\ support \adprep /domainprep. Press Enter
  • Although adprep/domainprep will update the domain-wide information. Run the last command D:\souces\adprep\adprep /domainprep/gpprep  or  D:\support\adprep\adprep /domainprep/gpprep

3. Install Active Directory Domain Services - Windows Server 2008

  • Click Start, in Start Search type "dcpromo" then press Enter
  • On the new Windows, click Continue button. "The setup will detect if the binaries are installed and if they are not it will install them"
  • After that, following the Active Directory Domain Services Installation Wizard

4. Setting a Windows Server 2008 Domain Controller as a Global Catalog

  • Click Start > Administrative Tools > Active Directory Sites and Services
  • From the left panel, expand Sites > Default-First-Site-Name > Server > Domain Controllers
  • Expand the Windows Server 2008 that you want to set as Global Catalog, right Click in NTDS Settings, then Click in Properties
  • Click in General Tab, there is a check box beside Global Catalog. Select this check box and click on Apply then OK

5. Transferring FSMO Roles in Windows Server 2008

Using Active Directory Schema snap-in to transfer the Schema Master Role. You have to register schmmgmt.dll in order to be able to use the Active Directory Schema snap-in.
  • Click Start > Run
  • Type regsvr32 schmmgmt.dll
  • A message information will confirm that schmmgmt.dll was successfully registered. Click OK
  • Click Start > Run 
  • Type mmc, and click OK
  • Click File > Add/Remove snap-in...
  • From the left side, under Available Snap-ins. Click to select Active Directory Schema, then click Add, and click OK
  • Right click Active Directory Schema > Change Active Directory Domain Controller...
  • Select This Domain Controller or AD LDS instance. Click on the Domain Controller that you want to be the Schema Master role and then click OK
  • You will receive a message box, click OK
  • In the console tree, right click Active Directory Schema (Domain Controller.Domain Name), and then click Operations Master...
  • Click Change
  • Click Yes to confirm the role transfer, and a new confirmation message will be displayed, click OK
  • In Change Schema Master windows, click Close 
Using Active Directory Domains and Trusts snap-in to transfer the Domain Naming Master Role.
  • Click Start > Administrative Tools > Active Directory Domains and Trusts
  • Right click Active Directory Domains and Trust, then click Change Active Directory Domain Controller...
  • Select This Domain Controller or AD LDS instance. Click on the Domain Controller that you want to be the Schema Master role and then click OK
  • Right click Active Directory Domains and Trust, then click Operation Master..
  • Click Change
  • Click Yes to confirm the role transfer, and a new confirmation message will be displayed, click OK
  • On Operation Master windows, click Close 
Using Active Directory Users and Computers snap-in to transfer the RID Master, PDC Emulator, and Infrastructure Master Roles.
  • Click Start > Administrative Tools > Active Directory Users and Computers
  • Right click Active Directory Users and Computers, click All Task > Operation Master...
  • Click Change button under each of these three tabs (RID, PDC, Infrastructure)
  • Click Yes to confirm the role transfer, and a new confirmation message will be displayed, click OK
  • When you click Change button on Infrastructure role, you will receive a message. Click Yes