PowerCLI: Export VM Guest Logs files to Local Computer

Last week I needed to export vmware.log files. In the normal way you can read using putty client or download log using Datastore Browser. But you also can download logs using PowerCLI. to do it, we using cmdlet Copy-DatastoreItem  cmdlet Syntax: Copy-DatastoreItem <Object> <Object>]   To find the location of a virtual machine run this script: get-vm MyVirtualMachine| Get-Datastore |Select name   Connect to Datastore using New-PSDrive cmdlet and change location to VM folder using Set-Location cmdlet. New-PSDrive -Location $datastore -Name ds -PSProvider VimDatastore -Root "\" Set-Location ds:\ cd $vm To display list log files, simple run ls *.log       At this point we can begin copy files from Datastore to local computer: Copy-DatastoreItem -Item *.log -Destination...
no comments

SCRIPT: Upgrade Zabbix_Agent 2.x to 3.x

Monday, July 18, 2016

Upgrading Zabbix_Agent 2.x to 3.x via batch script This topic will show one method to upgrade Zabbix agent version 2.x to 3.x #1 Check if last version installed. Zabbix agent version, file size is 433,644 bytes. So in this case, we check if current file size  Equal to 433,644 bytes,  If do - nothing to do. c: cd\ cd "Program Files\Zabbix Agent" dir | find "433,664 zabbix_agentd.exe" IF %errorlevel% ==0 GOTO END #2 Remove old ZabbixAgent version 2.x Remove old version in three stages: stop Zabbix agent service delete relevant files delete old files zabbix_agentd.exe -x zabbix_agentd.exe -d del *.* /Q #3 Copy ZabbixAgent version 3.x Copy relevant files: zabbix_agentd.exe zabbix_agentd.win.conf   A predefined file that include:   Server=My.Zabbix.Server ServerActive=My.Active.Zabbix.Server LogFile=c:\Program Files\Zabbix Agent\zabbix_agentd.log LogFileSize=10 DebugLevel=3 HostMetadata=Windows #4 Append Computer...
no comments


Tuesday, February 23, 2016

W32tm WINDOWS TIME SERVICE USEFUL COMMANDS   W32tm is powerful command line tool for setup, monitoring and manage time service on Windows systems. You can find relevant reference on TechNet website   Here some useful commands.   Note: You may need to launch an elevated Command Prompt (right-click Run as administrator)   #1 TIME OFFSET BETWEEN CURRENT COMPUTER TO YOUR DOAMIN C:\> w32tm /monitor /domain:DOMAIN /nowarn C:\> w32tm /stripchart /computer: DOMAIN /samples:5 /dataonly #2 DISPLAY THE CURRENT TIME ZONE SETTINGS C:\> w32tm /tz #3 LIST PEERS (EXTERNAL NTP SERVERS) C:\>w32tm /query /peers #4 RESTORE WINDOWS TIME SERVICE ON LOCAL COMPUTER TO DEFAULT SETTINGS Unregister service and remove all configuration information from the registry. C:\>net stop w32time C:\>w32tm /unregister C:\>w32tm...
no comments

How to wait in a batch script

Tuesday, November 18, 2014

How to wait in a batch script ? how waiting/sleeping for couple seconds ? Many sysadmin daily using scripting, some time we need to delay/sleep/wait before next command. The easy way to wait is using TIMEOUT command: The next video show you how :
tags: ,
no comments

Explorer UNC from CMD

Monday, October 13, 2014

How to explorer UNC folders from command line.   If you try to explorer UNC from cmd, you will get error : "CMD does not support UNC paths as current directories."   so, how can I explorer ?? Simple, using PUSHD command. c:\>pushd "\\SERVER\Shares\Information Technology" PUSHD will create a temporary drive letter that points to that specified network resource and then change the current drive and directory, using the newly defined drive letter.  Temporary drive letters are allocated from Z: on down, using the first unused drive letter found. . How to  delete temporary drive letter  ? simple - run popd.exe command. POPD Will delete any temporary drive letter created by PUSHD.      
tags: , , ,
no comments

VBS Script: Pop-up IP Info

Sunday, September 21, 2014

Here a little vbs script that pop-up IP address info: You can deploy this script to users desktop Copy and save as Info.vbs ' ======================= ' IP Info by Haim Coehn ' Version 1.0 ' Date: 21-Sep-2014 ' ======================= dim NIC1, Nic, StrIP, CompName Set NIC1 = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration") For Each Nic in NIC1 if Nic.IPEnabled then StrIP = Nic.IPAddress(i) Set WshNetwork = WScript.CreateObject("WScript.Network") CompName= WshNetwork.Computername Domain= WshNetwork.UserDomain UserName=WshNetwork.UserName MsgBox "Your IP Address is: " &StrIP & vbNewLine _ & vbNewLine _ & vbNewLine _ & "Please Provide IP Address" & vbNewLine _ & "to Technical Support." & vbNewLine _ & "",4160,"IP Info By Haim Cohen 2014" wscript.quit end if next  
tags: ,
no comments

IT Super Menu (old HelpDesk Tool)

Tuesday, September 9, 2014

IT Super Menu By Haim Cohen 2014 IT Super Menu is old version of Helpdesk Tool. i add some features , fix some bugs, and other changes. Change Log: ========== 03-Sep-2014, v3.7 > add new command: List Installed Windows Updates. > add new command: List Drivers. > Set Temp directory for reporting, C:\ITSuperMenu_Temp. > set unknowerror msg. > change location, from %tmp% to C:\ITSuperMenu_Temp (runas issue). 01-Sep-2014, v3.6 > Modify ASCII Text. > Set %TOOLS%. > add new option: Ping IP range. > add new command: tracert. 31-Aug-2014, v3.5d > Rename this tool, now called: `IT Super Menu` > Modify ASCII Text. > Set one location to all ASCII files. 21-Aug-2014, v3.5c > New Feature - Now when you open Helpdesk...
no comments

Helpdesk Tool v3.3 By Haim Cohen 2014

Wednesday, August 13, 2014

Update: IT Super Menu v3.7 available here Help Desk Tool v3.3 By Haim Cohen 2014 Helpdesk Tool By Haim Cohen 2014 So, I found my self with large folder and many Scripts. And now, i want to share with Helpdesk team, but in central menu. after few hours, i  wrote a cmd script with many tools, #This Script is free to use# Please don't remove author, and give me your feedback. You can download Full Script from here Requirements: 1. Port Query 2. PuTTY 3. VNC Viewer 4. SYDI-Server 5. PsExec  

DSQuery all servers in Active Directory

Monday, July 7, 2014

How to use DSQUERY to find computers in Active Directory ? Intro: Dsquery is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) server role installed. To use dsquery, you must run the dsquery command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator. Here a few examples; 1. Find all computers: dsquery * -Filter "(&(objectClass=computer)(operatingSystem=*))" -Attr name operatingSystem -limit 100000000   2. Find only Servers: dsquery * -Filter "(&(objectClass=computer)(operatingSystem=Windows Server *))" -Attr name operatingSystem -limit 100000000   3. Find Windows Server 2012: dsquery * -Filter...