Archive for November, 2012

Automating FTP tasks with cron

0

If you´re using ftp to download files from a contractor such as a logistics provider you can automate it using cron and the .netrc file.

1. Create a .netrc file in the home directory of the user who will be executing the script.

2. Open the .netrc file, “paste” the following text into it and change it

machine FQDN_OR_IP_ADDRESS
login USERNAME
password PASSWORD

macdef MACRONAME
prompt off
bin
cd PATH
lcd LOCALPATH
mget *

3. Enter crontab -e and hit enter

4. “Paste” the following text into it and change it

MM HH  * * * echo "$ MACRONAME" | ftp FQDN_OR_IP_ADDRESS

After applying this your files are being downloaded to the location and at the time you´ve defined.

Check if a service is running via PowerShell

0

I´ve found a script in another blog by Anders Mikkelsen which I found really good and quite helpful since I´ve experienced that different services on some machines have the habit not to start after the server is being rebooted because of an update or reboot cycle at night.

function FuncCheckService{
    param($ServiceName)
    $arrService = Get-Service -Name $ServiceName
    if ($arrService.Status -ne "Running"){
        Start-Service $ServiceName
        FuncMail -To "to-email@domain.com" -From "from-mail@domain.com"  -Subject "Servername : ($ServiceName) service started." -Body "Service $ServiceName started" -smtpServer "relay.mailserver.com"
    }
}
function FuncMail {
    #param($strTo, $strFrom, $strSubject, $strBody, $smtpServer)
    param($To, $From, $Subject, $Body, $smtpServer)
    $msg = new-object Net.Mail.MailMessage
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $msg.From = $From
    $msg.To.Add($To)
    $msg.Subject = $Subject
    $msg.IsBodyHtml = 1
    $msg.Body = $Body
    $smtp.Send($msg)
}
FuncCheckService -ServiceName "VMware VirtualCenter Server"

Just copy and paste this script, save it as a ps1 file and schedule it to run every x minutes…

PowerCLI 5.1 Poster

0

Some of you guys are knowing there are posters for reference for the VMware products.

I´ve attached a link to the updated PowerCLI 5.1 reference poster for you.

http://blogs.vmware.com/vipowershell/files/2012/09/PowerCLI_5_1_Poster.pdf

Visio Stencils for VMware

0

Here´s a list of links to downloads to create your VI documentation…

 

VMware

VMware View

 

The first link also contains a collection to other sites where you can download additional stencil packs.

Reference Cards for vSphere 4.x und 5.x

0

Some time ago I´ve found some reference cards for vSphere 4.x and 5.x from Forbes Guthrie (vreference.com)

They are quite helpful and Forbes has released them under CC License.

Here are the links to the reference cards:

vSphere 4

vSphere 5

Connection & Ports in ESX/ESXi

eBook “Introducing Windows Server 2012 (RTM Edition)”

0

I´ve stumbled over a link in another blog. Microsoft has released a free eBook about Windows Server 2012.

 

A key feature of this book is the inclusion of sidebars written by members of the Windows Server team, Microsoft Support engineers, Microsoft Consulting Services staff, and others who work at Microsoft. These sidebars provide an insider’s perspective that includes both “under-the-hood” information concerning how features work, and strategies, tips, and best practices from experts who have been working with the platform during product development.

 

You can download it via following link:

http://blogs.msdn.com/b/microsoft_press/archive/2012/09/05/free-ebook-introducing-windows-server-2012-rtm-edition.aspx

 

It´s not the newest post (05/11/12) but I´ve thought it might be interesting 😉

Create a shared action to create a new document

0

At first you have to create a new Shared Action and name it e.g. New Document.

Change Formula to LotusScript and paste following code into your action where <mask_name> should be replaced by your mask.

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Call workspace.ComposeDocument( '', '', '<mask_name>' )

End Sub

Renaming Windows Server 2008 Domain Controllers

0

You must be a member of the Domain Admins group to change the name of a Domain Controller.

To rename a Domain Controller with the name from <Old-Name-of-DC> in the MYTESTDOM.COM domain to <New-Name-of-DC> follow the next steps:

1. Open Command Prompt and type:

NETDOM computername <Old-Name-of-DC>.MYTESTDOM.COM /add:<New-Name-of-DC>.MYTESTDOM.COM

This command will update the service principal name (SPN) attributes in Active Directory for this computer account, and register DNS resource records for the new computer name. The SPN value of the computer account must be replicated to all Domain Controllers for the domain, and the DNS resource records for the new computer name must be distributed to all the authoritative DNS servers for the domain name.

If the updates and registrations have not occurred prior to removing the old computer name, then some clients may be unable to locate this computer using the new or old name. Therefore, it’s very important to wait till the Active Directory replication finishes a replication cycle.

You can check that by using tools such as REPADMIN and REPLMON. You can verify the new name was indeed added to the computer object by viewing it through ADSIEDIT.MSC (which, for Windows Server 2008, is installed by default).

– Navigate to the computer object and right-click it.

– Select Properties: Scroll down in the list of available attributes till you reach the attribute called msDS-AdditionalDnsHostName.

2. Ensure the computer account updates and DNS registrations are completed, then type:

NETDOM computername <Old-Name-of-DC>.MYTESTDOM.COM /makeprimary:<New-Name-of-DC>.MYTESTDOM.COM

Again, you can inspect the change with ADSIEDIT.MSC. Scroll down in the list of available attributes for the computer object (notice how the server now appears with the new name) till you reach the attribute called msDS-AdditionalDnsHostName.

Notice that the old name should appear in the attribute’s properties.

3. Restart the computer.

4. From the command prompt, type:

NETDOM computername <New-Name-of-DC>.MYTESTDOM.COM /remove:<Old-Name-of-DC>.MYTESTDOM.COM

5. Make sure that the changes have successfully been replicated to all the Domain Controllers.

Repeating ADAM VMwareVCMSDS Error Every Minute in Windows Active Directory Web Services Log

0

To fix this you have to go into the registry and look for in the key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet?\Services\ADAM_VMwareVCMSDS\Parameters for Port SSL.

If Port SSL is already there as a string (REG_SZ), delete it and create a new REG_DWORD named Port SSL and set the value to 636 (Decimal). Then you need to restart the two services “Active Directory Web Services” and “VMwareVCMSDS”.

Invalid or nonexistent document mail.box

0

Normally an ‘Invalid or Nonexistent document’ mean bad or corrupted view indexes.

To resolve this issue you have to open your Domino Administrator Client and go to the server console

and put in the command

load updall mail.box -R

and hit enter.

 

 

Go to Top