Archive for the 'IT' Category

Find old Computers/users in Active Directory

Easiest way is to use following query on your Domain Controller to find all computers which were inactive for 4 weeks:
dsquery computer –inactive 4

The same you could for users:
dsquery users – inactive 4

No Comments »

admin on March 22nd 2012 in Windows, Windows Server

Batch check if a Program or Service is running

tasklist /FI "IMAGENAME eq %PROGNAME%" 2>NUL | find /I /N "%PROGNAME%">NUL
if "%ERRORLEVEL%"=="0" echo Programm is running
if "%ERRORLEVEL%"=="1" echo Programm is not running

%PROGNAME% needs to be replaced with your program name.

No Comments »

admin on February 18th 2012 in IT, Windows

sendEmail from Bash over GMail

The syntax is following:
sendEmail -v –f $EMAIL_FROM -s smtp.gmail.com:587 -xu p$USERNAME –xp $PASSWORD –t $EMAIL_TO -o tls=yes –u $SUBJECT –m $MESSAGE

But after I tried it I got following message:
ERROR => No TLS support!  SendEmail can’t load required libraries. (try installing Net::SSLeay and IO::Socket::SSL

This fixed the problem:
apt-get install libio-socket-ssl-perl libnet-ssleay-perl

No Comments »

admin on February 10th 2012 in Linux

Color LInux Prompt

vi ~/.bashrc

To color it red change PS1 to:
export PS1=’\[\e[1;31m\][\u@\h \W]\$\[\e[0m\] ‘

After that you need to save it and reload it with:
source ~/.bashrc

No Comments »

admin on February 8th 2012 in IT, Linux

Quick and Dirty MS Database Analysis

This method queries all tables in a database and it displays the top 10 rows.

Get all tables with the following query:
SELECT name FROM ssysobjects WHERE type = ‘u’;

Copy&Paste it into Excel A Column and put following Formula into B Column for each row:
="SELECT TOP 10 * FROM " & A1 &";"

Result will be something like this:
SELECT TOP 10 * FROM COMPANY; SELECT TOP 10 * FROM PEOPLE; SELECT TOP 10 * FROM BILLS;

Run this query in Microsoft Management Studio an analyse the result.

No Comments »

admin on February 4th 2012 in MSSQL

Treesize in Linux Command Console

I love the program treesize on windows and I was looking for a script to do the same on linux.

Thanks to Andrew who made this neat script:

No Comments »

admin on January 31st 2012 in Linux

Using nmap to check if multiple hosts are up

nmap -sP 192.168.1.0-255

No Comments »

admin on December 31st 2011 in IT, Linux

HOw to stay connected to a Windows Network Share even after a reboot in Linux

You just need to edit  the /etc/fstab and following line:
//$ShareName  /mnt/$FolderName    cifs      username=$username,password=$password    0    0

To reload the files system:
mount -a

No Comments »

admin on November 18th 2011 in IT, Linux

When did I install Windows?

cmd
systeminfo

No Comments »

admin on November 18th 2011 in IT, Windows, Windows Server

Administrator can’t access server Saved Profiles

To be able to open Server Saved Profiles from Users you need to take ownership over the folder and subfolders. After that you can add the Administrator Account to the NTFS permissions and give it full rights. After that it should workd.

If you want to solve this problem in advanced you can enable this GPO:
Computer Configuration\Administrative Templates\System\ User Profiles\Add the Administrator security group to the roaming user profile share

After that the Administrator is able to acccess the profiles without the need of taking ownership.

No Comments »

admin on September 8th 2011 in IT, Windows, Windows Server




Check out new movies online website. Download and buy movies now.