mercoledì 6 novembre 2013

How To Determine Physical Memory on a Remote Machine (slots, chips number and size...)

Hi all,
after a lot of time far from my blog, I'm here again, this time to post a simple and quick command to determine remotely how much physical ram is installed on a machine.

open a command prompt and execute this (replace "server01" with your server name):
wmic /node:server01 memorychip get banklabel, devicelocator,caption,capacity

the result in my case is:

BankLabel  Capacity    Caption          DeviceLocator
           1073741824  Physical Memory  DIMM 01
           1073741824  Physical Memory  DIMM 02
           1073741824  Physical Memory  DIMM 03
           1073741824  Physical Memory  DIMM 04

so, there are 4 dimm installed, each one 1GB 

If you need, there are also other information, from command prompt try (change server01) :


wmic

/node:server01
memorychip

you'll see all the columns available.

You could also try to run
wmic /node:server01 mmemorychip
but the output is a little bit messed up, I don't suggest it to you

bye
Digger

mercoledì 13 febbraio 2013

Outlook Shared Mailbox - folder disappeared

Hi all,
this time I would like to share what I just discovered on Outlook.

We are using many Outlook with the cache enabled in our company, connected to the Exchange server in another country with a slow wan connection.

Many users have shared mailboxes configured in Outlook and it happens very often that some folder simply "disappear" from the shared mailbox.
But it is not deleted, because using web-access (OWA) the folder is still there!

It seems that nothing but delete the cache can resolve this, I tried scanost, tried closing outlook, restarting the pc, and many other things but at the end only deleting and recreating the cache resolved the issue and make the folder reappeas.
The problem is the bandwidth impact, if you are using a slow wan like me is a nightmare to delete 10GB of cache and redownload from the WAN, it could take hours!

Until now.
I discovered that the workaround is simply to go to one of the user that doesn't see the folder anymore and CREATE a new folder with a RANDOM name in the shared mailbox (for example "dummy").
Once done it happened to me that magically the missing folder reappered to the ALL the users that was missing it! so not just on this pc but also all the other.

The workaround is not perfect, in one occasion the first time I tried the folder appeared and disappeared in 1 second, I had to delete the dummy folder and recreate again, the missing one appeared and I clicked it so that the sync process started. From that point on , the folder didn't disappeared again.

Also I still need to test it in other situations, for example in mailboxes with many sub-folders, but until now this is the faster and less bandw. impacting workaround I have found.

Let me know your experience and if this workaround is working also for you :)

bye
Digger

lunedì 10 dicembre 2012

Convert scheduled jobs from XP / W2003 to W7 / W2008 Server

If you need to convert some scheduled jobs from XP to W7 or from Windows Server 2003 to Windows Server 2008 there is this interesting way I found on this blog:
http://simonhampel.com/how-to-convert-scheduled-tasks-from-windows-xp-to-windows-7/

This is how to do it:
On the W2008 / W7 machine open a console prompt with administrative rights and write this:

schtasks /Query /S remote_computer_name /XML > output_file.xml

if you don't have rights on the remote machine you need to specify user/password:

schtasks /Query /S remote_computer_name /U remote_username /P remote_password /XML > output_file.xml

What you obtain is a file, output_file.xml containing all the scheduled tasks from the remote machine.

You cannot import directly this file into the W2008/W7 machine, because it contains all the taks, the import process is expecting a single task instead.

With a copy and paste process you need to create one file for every task you want to import.
This is quite simple, you need to copy and paste from <task> to </task> to a new xml file:

<Task version="1.1" ...>
...
...
</Task>

Then you need to go to the W2008 / W7 machine, scheduled tasks, right click, "Import...", select the file/s you just created and the task is imported.




mercoledì 21 novembre 2012

Excel 2010 XLQUERY.XLA!Register.DClick Problem

It's a long time now that I'm experiencing this issue when I open some old excel files using Excel 2010.
Those files are very old, created probably using Excel 95/97 then used with Excel 2003 and now with 2010.
The annoying thing about those files is that when I open one of them this error appear:


Cannot find XLQUERY.XLA!Register.DClick, which has been assigned to run each time filename.xls is opened. Continuing could cause errors. Cancel opening filename.xls?
If I click "No" the file opens and works fine, but it's annoing the message, so I tried to remove it.

Unfortunately I didn't find any reference to that XLQUERY.XLA around the file.

I tried googling and find this interesting Microsoft page explaining it and giving a solution:

http://support.microsoft.com/kb/277620/en-us

This is the code suggested to be run to solve the issue:

Sub deletem()
       For Each n In ActiveWorkbook.Names
           If n.Visible = False And InStr(1, n.Name, "QUERY") > 0 And _
           InStr(1, n.Name, "Query_from") = 0 Then
                   n.Delete
           End If
       Next 
End Sub 


Ok, unfortunately in my case (I'm using Excel 2010) it didn't solve anything.

(my) SOLUTION:

This is what I did to solve my issue (I don't assume responsability if this will make you loose your data ;) ):

1. opened the XLS file and saved it with the new extension XLSX (or xlsm in case of macro), let's say it's called "MyFile.xls" -> "MyFile.xlsx" (don't just change the extension! you need to open it and save with the different format!)
2. uncompressed the file using 7Zip (but I suppose you can simply rename it .zip and use the W7 integrated zip feature to do it) obtaining a folder "MyFile" containing many folders and files inside
3. using "Agent Ransack" to search INSIDE the files in that folder I found the one containing the evil reference, it was "workbook.xml" inside "xl" folder

Searching for "xlquery" I found this :

<definedName name="_xlnm.Auto_Open_xlquery_DClick" localSheetId="1" hidden="1">[1]!Register.DClick</definedName>

I simply selected the whole part above and deleted, then saved the workbook.xml file changed.

The problem now is that I have this folder with all those files but I need an xlsx (xlsm) file so...

4. opened the "MyFile" folder, right clicked, "new compressed folder", changed the name to MyFile.zip
5. drag and dropped all the files and folders contained in MyFile folder into MyFile.zip
6. renamed MyFile.zip into MyFile.xlsx (.xlsm)
7. opened the file and tada! it worked fine without the error message anymore :)

I'm still testing it to see if this procedure could lead to some issue using the excel file but it doesn't seems so.

NOTES:
1. I'm doing this with Excel 2010 but probably it works also with Excel 2007 as if I remember well it already had the new xml zipped format, let me know ;)
2. be careful when you re-zip into xlsx file to NOT include the MyFile folder itself!! else you'll get an error opening the rezipped file, so please DON'T right-click on the MyFile folder and "send to compressed folder", this will NOT work, you need to CREATE a new zip file and drag and drop just the folders and files CONTAINED in the MyFile folder. I'm telling this to you because I lost a lot of time trying to understand why the rezipped file was not working :D

Good luck
bye
digger

venerdì 16 dicembre 2011

Configure DHCP server onto Ubuntu Server 11.04

Hi all,
today I will show you how to configure a DHCP server onto Ubuntu Server 11.04 already running.

first you should check that the server has a static ip address,

vi /etc/network/interfaces


in my case is something like this:

auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.255
gateway 192.168.0.1

then check for the name servers:

vi /etc/resolv.conf


I have this:
nameserver 192.168.0.1


if you change yours files (interfaces and/or resolv.conf) , you need to type this:

/etc/init.d/networking restart


check also your hostname file:

vi /etc/hosts

should be something like this:

127.0.0.1          localhost.localdomain  localhost
192.168.0.100  server1.example.com server1

bcause in my case the server is called "server1"

DHCP installation and configuration


First download and install the dhcp service:

sudo apt-get install dhcp3-server


after the installation you will see a failed status, but it's ok, because we still need to configure the service.

vi /etc/dhcp/dhcpd.conf


Now we are going to change the file to configure our subnet,
in my case my server is 192.168.0.100 so my configuration will be something like this:

subnet 192.168.0.0 netmask 255.255.255.0 {
 range 192.168.0.10 192.168.0.50;
 option broadcast-address 192.168.0.255;
 option routers 192.168.0.1;
}

This way the service will release addresses in the range 192.168.0.10 -> 192.168.0.50

save the file and restart the dhcp service:

/etc/init.d/isc-dhcp-server start


Now the dhcp should be working fine.

There are a lot of other options that can be configured in the dhcpd.conf file, check the documentaiton for that

bye
Digger

mercoledì 14 dicembre 2011

Sniff switched network with ettercap-ng for windows

Hi all,
a quick guide about one (there are other) way to sniff network traffic in a switched lan.

The enviroment is:

PCA
PCB
monitoring-PC (os: win xp, 2 NICs installed)

my monitoring pc is a laptop with only 1 nic, so I used a DLINK external USB NIC (name: DUB-E100) as second NIC.

PCA is connecting to PCB

on your "monitoring-PC" you want to see(sniff) the traffic between A and B but you cannot install anything on them and they are connected using a switch.

The problem is that in a switched enviroment you usually cannot sniff packets like you do using an HUB.
If you have an hub you can connect it in the middle, else if you have a way to setup a monitoring port on the switch, ok, but else it's a problem.

You could ARP poisoning the devices to then sniff (or also do a mac flooding to put the switch in a failed open state), but in my experience this could be dangerous sometimes and it often doesn't work very well.

SOLUTION


A solution I found today is to use ETTERCAP-NG for windows.
You can install it on your monitoring pc, using 2 network card, configure it for a "bridged sniffing" and then run a sniffer like "Wireshark".
You simply need to disconnect A or B and put your monitoring pc in the middle using the 2 NICs.

example:

A--- (nic1)monitoringPC(nic2) ---- switch ----B
or

A--- switch ---(nic1)monitoringPC(nic2) ------B
or
...etc (exchange nic1 and nic2)


This way the monitoringPC is acting as a bridge and the packets between A and B are visible on the monitoringPC.



ETTERCAP-NG
http://sourceforge.net/projects/ettercap/files/
open "unofficial binaries", then "windows", then download "ettercap-NG-0.7.3-win32.exe"

WIRESHARK
http://www.wireshark.org/


INSTRUCTIONS (on the monitoring pc with 2 nics installed, in my case XP operating system)

Download and install ettercap-ng, then download and install wireshark.

Start Ettercap-ng
from the "Sniff" menu select "Bridged sniff"



Then from the windows that appear select the nics to be used for creating the bridge



Now from the "Start" menu select "Start sniffing"


Now you can open "Wireshark" (or other sniffing tool) to see the traffic



The red arrows indicate what I changed from the default.
Important is to select "promiscuous" else you'll not see all the packets as they are not directed to you (the monitorinc pc), then I changed the nic to the USB one (but also the other is ok).
Unflagged "Automatic scrolling" because I prefere this way, but this is up to you.

That's all, at this point you should see all the packets between the 2 machines.

bye
Digger





venerdì 2 dicembre 2011

Windows 7 Search - missing files - resolution

Hi all,
are you in the same situation as me?

Are you searching in a particular folder (and subfolders) for a filename, or for content, and AS ALWAYS windows 7 search doesn't find it? also if you know for sure the file is there and/or the content is there in some file??

Honestly I hate the way Windows 7 indexes everything (slowing down the pc) just to speed up searching something from time to time, and then also you don't find it because at the end it doesn't work as it should...

Ok, there are some tips to make windows search working better, like unflagging all the folders in the indexing option, in this way windows will search not using the indexing at all.
Then you'll not find content anymore I suspect, so you should flag the folder "one shot" just to start indexing on demand (but you should also disable indexing backoff to make it works).

Ok, the REAL solution?

DON'T USE WINDOWS SEARCH... use something else

Unflag ALL the flags in the indexing options so that no folder is indexed (this will speed up you pc in some way), just keep Outlook flag so you can search mails.

Then istall some search tool (I'm using Agent Ransack as it does its job well) and use it instead!